Class: VagrantPlugins::Rackspace::Action::ListFlavors
- Inherits:
-
Object
- Object
- VagrantPlugins::Rackspace::Action::ListFlavors
- Defined in:
- lib/vagrant-rackspace/action/list_flavors.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ ListFlavors
constructor
A new instance of ListFlavors.
Constructor Details
#initialize(app, env) ⇒ ListFlavors
Returns a new instance of ListFlavors.
5 6 7 |
# File 'lib/vagrant-rackspace/action/list_flavors.rb', line 5 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/vagrant-rackspace/action/list_flavors.rb', line 9 def call(env) compute_service = env[:rackspace_compute] env[:ui].info ('%-36s %s' % ['Flavor ID', 'Flavor Name']) compute_service.flavors.sort_by(&:id).each do |flavor| env[:ui].info ('%-36s %s' % [flavor.id, flavor.name]) end @app.call(env) end |