Class: Vra::Catalog
- Inherits:
-
Object
- Object
- Vra::Catalog
- Defined in:
- lib/vra/catalog.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #all_items ⇒ Object
- #entitled_items ⇒ Object
-
#initialize(client) ⇒ Catalog
constructor
A new instance of Catalog.
- #request(*args) ⇒ Object
Constructor Details
#initialize(client) ⇒ Catalog
Returns a new instance of Catalog.
23 24 25 |
# File 'lib/vra/catalog.rb', line 23 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
21 22 23 |
# File 'lib/vra/catalog.rb', line 21 def client @client end |
Instance Method Details
#all_items ⇒ Object
27 28 29 30 |
# File 'lib/vra/catalog.rb', line 27 def all_items client.http_get_paginated_array!('/catalog-service/api/consumer/catalogItems') .map! { |x| Vra::CatalogItem.new(client, data: x) } end |
#entitled_items ⇒ Object
32 33 34 35 |
# File 'lib/vra/catalog.rb', line 32 def entitled_items client.http_get_paginated_array!('/catalog-service/api/consumer/entitledCatalogItems') .map! { |x| Vra::CatalogItem.new(client, data: x['catalogItem']) } end |
#request(*args) ⇒ Object
37 38 39 |
# File 'lib/vra/catalog.rb', line 37 def request(*args) Vra::CatalogRequest.new(@client, *args) end |