Class: Kato::InstanceStatus
- Inherits:
-
Object
- Object
- Kato::InstanceStatus
- Defined in:
- lib/kato/pool_manager.rb
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
Returns the value of attribute instance_id.
-
#last_interval ⇒ Object
Returns the value of attribute last_interval.
-
#state ⇒ Object
Returns the value of attribute state.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance_id, state, last_interval, timestamp) ⇒ InstanceStatus
constructor
A new instance of InstanceStatus.
Constructor Details
#initialize(instance_id, state, last_interval, timestamp) ⇒ InstanceStatus
Returns a new instance of InstanceStatus.
240 241 242 |
# File 'lib/kato/pool_manager.rb', line 240 def initialize(instance_id, state, last_interval, ) @instance_id, @state, @last_interval, @timestamp = instance_id, state, last_interval, end |
Instance Attribute Details
#instance_id ⇒ Object
Returns the value of attribute instance_id.
238 239 240 |
# File 'lib/kato/pool_manager.rb', line 238 def instance_id @instance_id end |
#last_interval ⇒ Object
Returns the value of attribute last_interval.
238 239 240 |
# File 'lib/kato/pool_manager.rb', line 238 def last_interval @last_interval end |
#state ⇒ Object
Returns the value of attribute state.
238 239 240 |
# File 'lib/kato/pool_manager.rb', line 238 def state @state end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
238 239 240 |
# File 'lib/kato/pool_manager.rb', line 238 def @timestamp end |
Class Method Details
.parse(xml_or_yaml) ⇒ Object
244 245 246 247 248 249 250 251 |
# File 'lib/kato/pool_manager.rb', line 244 def self.parse(xml_or_yaml) if xml_or_yaml =~ /<InstanceStatus>/ # FIXME Parse the xml else status = YAML.load(xml_or_yaml) new(status[:instance_id], status[:state], status[:last_interval], status[:timestamp]) end end |