Class: Sambot::Rackspace::Flavors
- Inherits:
-
Object
- Object
- Sambot::Rackspace::Flavors
- Defined in:
- lib/sambot/rackspace/flavors.rb
Instance Method Summary collapse
- #all ⇒ Object
- #available ⇒ Object
-
#initialize(client) ⇒ Flavors
constructor
A new instance of Flavors.
Constructor Details
#initialize(client) ⇒ Flavors
Returns a new instance of Flavors.
5 6 7 |
# File 'lib/sambot/rackspace/flavors.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all ⇒ Object
9 10 11 |
# File 'lib/sambot/rackspace/flavors.rb', line 9 def all @client.flavors.all.map { |flavor| { name: flavor.name, value: flavor.id } }.compact end |
#available ⇒ Object
13 14 15 |
# File 'lib/sambot/rackspace/flavors.rb', line 13 def available all.find_all { |x| x[:name] =~ /Standard/ } end |