Class: Ruboty::Niftycloud::Actions::AccountUse
- Defined in:
- lib/ruboty/niftycloud/actions/account_use.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#accounts, #computing, #current_account, #current_region, #initialize, #rdb
Constructor Details
This class inherits a constructor from Ruboty::Niftycloud::Actions::Base
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ruboty/niftycloud/actions/account_use.rb', line 5 def call target = [:target] if target.match(/^\d+$/) account = accounts[target.to_i] else account = accounts.find {|account| account[:name] == target } end if !account return .reply("Error: account not found") end current_account(account[:name]) .reply("using: #{account[:name]}") end |