Class: Fog::Compute::VcloudDirector::Collection
- Inherits:
-
Fog::Collection
- Object
- Array
- Fog::Collection
- Fog::Compute::VcloudDirector::Collection
- 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 Attribute Summary
Attributes inherited from Fog::Collection
Instance Method Summary collapse
- #all(lazy_load = true) ⇒ Object
- #get(item_id) ⇒ Object
- #get_by_name(item_name) ⇒ Object
- #get_everyone ⇒ Object
- #index ⇒ Object
Methods inherited from Fog::Collection
#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Method Details
#all(lazy_load = true) ⇒ Object
296 297 298 |
# File 'lib/fog/vcloud_director/compute.rb', line 296 def all(lazy_load=true) lazy_load ? index : get_everyone end |
#get(item_id) ⇒ Object
300 301 302 303 304 |
# File 'lib/fog/vcloud_director/compute.rb', line 300 def get(item_id) item = get_by_id(item_id) return nil unless item new(item) end |
#get_by_name(item_name) ⇒ Object
306 307 308 309 310 |
# File 'lib/fog/vcloud_director/compute.rb', line 306 def get_by_name(item_name) item_found = item_list.detect {|item| item[:name] == item_name} return nil unless item_found get(item_found[:id]) end |
#get_everyone ⇒ Object
316 317 318 319 |
# File 'lib/fog/vcloud_director/compute.rb', line 316 def get_everyone items = item_list.map {|item| get_by_id(item[:id])} load(items) end |
#index ⇒ Object
312 313 314 |
# File 'lib/fog/vcloud_director/compute.rb', line 312 def index load(item_list) end |