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.
24 25 26 |
# File 'lib/vra/catalog.rb', line 24 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
22 23 24 |
# File 'lib/vra/catalog.rb', line 22 def client @client end |
Instance Method Details
#all_items ⇒ Object
28 29 30 31 |
# File 'lib/vra/catalog.rb', line 28 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
33 34 35 36 |
# File 'lib/vra/catalog.rb', line 33 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
38 39 40 |
# File 'lib/vra/catalog.rb', line 38 def request(*args) Vra::CatalogRequest.new(@client, *args) end |