Class: OsCtld::AutoStart::Config
- Inherits:
-
Object
- Object
- OsCtld::AutoStart::Config
- Defined in:
- lib/osctld/auto_start/config.rb
Instance Attribute Summary collapse
-
#ct ⇒ Object
readonly
Returns the value of attribute ct.
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Class Method Summary collapse
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Sort by priority and container id.
- #dump ⇒ Object
- #dup(new_ct) ⇒ Object
-
#initialize(ct, priority, delay) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(ct, priority, delay) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 |
# File 'lib/osctld/auto_start/config.rb', line 9 def initialize(ct, priority, delay) @ct = ct @priority = priority @delay = delay end |
Instance Attribute Details
#ct ⇒ Object (readonly)
Returns the value of attribute ct.
7 8 9 |
# File 'lib/osctld/auto_start/config.rb', line 7 def ct @ct end |
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
7 8 9 |
# File 'lib/osctld/auto_start/config.rb', line 7 def delay @delay end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
7 8 9 |
# File 'lib/osctld/auto_start/config.rb', line 7 def priority @priority end |
Class Method Details
.load(ct, cfg) ⇒ Object
3 4 5 |
# File 'lib/osctld/auto_start/config.rb', line 3 def self.load(ct, cfg) new(ct, cfg['priority'], cfg['delay']) end |
Instance Method Details
#<=>(other) ⇒ Object
Sort by priority and container id
16 17 18 |
# File 'lib/osctld/auto_start/config.rb', line 16 def <=>(other) [priority, ct.id] <=> [other.priority, other.ct.id] end |
#dump ⇒ Object
20 21 22 23 24 25 |
# File 'lib/osctld/auto_start/config.rb', line 20 def dump { 'priority' => priority, 'delay' => delay } end |
#dup(new_ct) ⇒ Object
27 28 29 30 31 |
# File 'lib/osctld/auto_start/config.rb', line 27 def dup(new_ct) ret = super() ret.instance_variable_set('@ct', new_ct) ret end |