Class: HP::Cloud::Flavors

Inherits:
FogCollection show all
Defined in:
lib/hpcloud/flavors.rb

Instance Attribute Summary

Attributes inherited from FogCollection

#items, #name

Instance Method Summary collapse

Methods inherited from FogCollection

#create, #empty?, #filter, #get, #get_array, #unique

Constructor Details

#initializeFlavors

Returns a new instance of Flavors.



27
28
29
30
# File 'lib/hpcloud/flavors.rb', line 27

def initialize()
  super("flavor")
  @items = @connection.compute.flavors.all(:details=>true)
end

Instance Method Details

#matches(arg, item) ⇒ Object



32
33
34
35
36
# File 'lib/hpcloud/flavors.rb', line 32

def matches(arg, item)
  name = item.name.to_s
  shortname = name.gsub(/standard\./,'')
  return ((arg == item.id.to_s) || (arg == name) || (arg == shortname))
end