Class: Fog::Compute::VcloudDirector::Collection
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::VcloudDirector::Collection
show all
- Defined in:
- lib/fog/vcloud_director/compute.rb
Direct Known Subclasses
CatalogItems, Catalogs, Disks, Medias, Networks, Organizations, Tags, Tasks, Vapps, Vdcs, VmCustomizations, VmNetworks, Vms
Instance Method Summary
collapse
Instance Method Details
#all(lazy_load = true) ⇒ Object
297
298
299
|
# File 'lib/fog/vcloud_director/compute.rb', line 297
def all(lazy_load=true)
lazy_load ? index : get_everyone
end
|
#get(item_id) ⇒ Object
301
302
303
304
305
|
# File 'lib/fog/vcloud_director/compute.rb', line 301
def get(item_id)
item = get_by_id(item_id)
return nil unless item
new(item)
end
|
#get_by_name(item_name) ⇒ Object
307
308
309
310
311
|
# File 'lib/fog/vcloud_director/compute.rb', line 307
def get_by_name(item_name)
item_found = item_list.find {|item| item[:name] == item_name}
return nil unless item_found
get(item_found[:id])
end
|
#get_everyone ⇒ Object
317
318
319
320
|
# File 'lib/fog/vcloud_director/compute.rb', line 317
def get_everyone
items = item_list.map {|item| get_by_id(item[:id])}
load(items)
end
|
#index ⇒ Object
313
314
315
|
# File 'lib/fog/vcloud_director/compute.rb', line 313
def index
load(item_list)
end
|