Class: VagrantPlugins::Vrealize::EntitledItemsCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vrealize/vra_client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vra, entitled_items) ⇒ EntitledItemsCollection

Returns a new instance of EntitledItemsCollection.



62
63
64
65
# File 'lib/vagrant-vrealize/vra_client.rb', line 62

def initialize(vra, entitled_items)
  @vra = vra
  @entitled_items = entitled_items
end

Class Method Details

.fetch(vra) ⇒ Object



58
59
60
# File 'lib/vagrant-vrealize/vra_client.rb', line 58

def self.fetch(vra)
  new(vra, vra.entitled_catalog_items)
end

Instance Method Details

#find(&blk) ⇒ Object



67
68
69
70
71
# File 'lib/vagrant-vrealize/vra_client.rb', line 67

def find(&blk)
  found_item = @entitled_items.find(&blk)
  raise "No catalog item was found." unless found_item
  CatalogRequest.new(@vra, found_item.id)
end

#find_by_id(id) ⇒ Object



77
78
79
# File 'lib/vagrant-vrealize/vra_client.rb', line 77

def find_by_id(id)
  find{|item| item.id == id}
end

#find_by_name(name) ⇒ Object



73
74
75
# File 'lib/vagrant-vrealize/vra_client.rb', line 73

def find_by_name(name)
  find{|item| item.name == name}
end