mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00

Mitigation for Fog::ToHashDocument. This is (still) a short-term fix until we get to real response parsers.
30 lines
637 B
Ruby
30 lines
637 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/vcloud_director/models/compute/task'
|
|
|
|
module Fog
|
|
module Compute
|
|
class VcloudDirector
|
|
|
|
class Tasks < Collection
|
|
model Fog::Compute::VcloudDirector::Task
|
|
|
|
attribute :organization
|
|
|
|
def get(id)
|
|
data = service.get_task(id).body
|
|
return nil unless data
|
|
data[:id] = data[:href].split('/').last
|
|
new(data)
|
|
end
|
|
|
|
private
|
|
|
|
def item_list
|
|
data = service.get_task_list(organization.id).body
|
|
data[:Task].each {|task| service.add_id_from_href!(task)}
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|