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

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Task

Returns a new instance of Task.



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

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 = service.parse(new_owner)
  if new_result
    self.result = service.parse(new_result)
  end
  self.error = service.parse(new_error) if new_error
  @cancel_link = service.parse(new_cancel_link) if new_cancel_link
end

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fog/terremark/models/shared/task.rb', line 32

def ready?
  @status == 'success'
end