Class: VCloud::Catalog
- Inherits:
-
BaseVCloudEntity
- Object
- BaseVCloudEntity
- VCloud::Catalog
- Defined in:
- lib/vcloud/user/catalog.rb
Overview
Contains a collection of CatalogItem references
Instance Method Summary collapse
-
#get_catalog_item_from_name(name, session = self.session) ⇒ VCloud::CatalogItem
Retrieves an CatalogItem, assuming the user has access to it.
-
#get_catalog_item_references_by_name ⇒ Hash{String => VCloud::Reference}
Returns a hash of of all CatalogItem references, keyed by the CatalogItem name.
Methods inherited from BaseVCloudEntity
attr_accessor, attr_reader, attr_writer, from_reference, inherited, #initialize, type
Methods included from RestApi
#build_generic_http_opts, #create, #delete, #http_request, #parse_response, #post, #refresh, #update
Constructor Details
This class inherits a constructor from VCloud::BaseVCloudEntity
Instance Method Details
#get_catalog_item_from_name(name, session = self.session) ⇒ VCloud::CatalogItem
Retrieves an CatalogItem, assuming the user has access to it
26 27 28 29 30 |
# File 'lib/vcloud/user/catalog.rb', line 26 def get_catalog_item_from_name(name, session = self.session) catalog_items = get_catalog_item_references_by_name item = catalog_items[name] or return nil CatalogItem.from_reference(item, session) end |
#get_catalog_item_references_by_name ⇒ Hash{String => VCloud::Reference}
Returns a hash of of all CatalogItem references, keyed by the CatalogItem name
17 18 19 |
# File 'lib/vcloud/user/catalog.rb', line 17 def get_catalog_item_references_by_name Hash[catalog_item_references.collect{ |i| [i.name, i] }] end |