Class: Fog::Terremark::Shared::Task

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/terremark/models/shared/task.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

#initialize(attributes = {}) ⇒ Task

Returns a new instance of Task.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/terremark/models/shared/task.rb', line 19

def initialize(attributes = {})
  new_owner  = attributes.delete('Owner')
  new_result = attributes.delete('Result')
  new_error = attributes.delete('Error')
  new_cancel_link = attributes.delete('Link')

  super
  self.owner = connection.parse(new_owner)
  if new_result
    self.result = connection.parse(new_result)
  end
  self.error = connection.parse(new_error) if new_error
  @cancel_link = connection.parse(new_cancel_link) if new_cancel_link
end

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/fog/terremark/models/shared/task.rb', line 34

def ready?
  @status == 'success'
end