Class: HP::Cloud::Flavors
- Inherits:
-
FogCollection
- Object
- FogCollection
- HP::Cloud::Flavors
- Defined in:
- lib/hpcloud/flavors.rb
Instance Attribute Summary
Attributes inherited from FogCollection
Instance Method Summary collapse
-
#initialize ⇒ Flavors
constructor
A new instance of Flavors.
- #matches(arg, item) ⇒ Object
Methods inherited from FogCollection
#create, #empty?, #filter, #get, #get_array, #unique
Constructor Details
#initialize ⇒ Flavors
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 |