Class: Vra::Catalog

Inherits:
Object
  • Object
show all
Defined in:
lib/vra/catalog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (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_itemsObject



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_itemsObject



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