Class: Sambot::Rackspace::Flavors

Inherits:
Object
  • Object
show all
Defined in:
lib/sambot/rackspace/flavors.rb

Instance Method Summary collapse

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

#allObject



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

#availableObject



13
14
15
# File 'lib/sambot/rackspace/flavors.rb', line 13

def available
  all.find_all { |x| x[:name] =~ /Standard/ }
end