Class: Fog::Scaleway::Compute::Tasks

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/scaleway/models/compute/tasks.rb

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
# File 'lib/fog/scaleway/models/compute/tasks.rb', line 7

def all
  tasks = service.list_tasks.body['tasks']
  load(tasks)
end

#get(identity) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fog/scaleway/models/compute/tasks.rb', line 12

def get(identity)
  if (task = service.get_task(identity).body['task'])
    new(task)
  end
rescue Fog::Scaleway::Compute::UnknownResource
  nil
end