Class: Akashiyaki::Command
- Inherits:
-
Object
- Object
- Akashiyaki::Command
- Defined in:
- lib/akashiyaki/command.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
-
#initialize(mode, action, account) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(mode, action, account) ⇒ Command
Returns a new instance of Command.
10 11 12 13 14 |
# File 'lib/akashiyaki/command.rb', line 10 def initialize(mode, action, account) @mode = mode @action = action @account = account end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
8 9 10 |
# File 'lib/akashiyaki/command.rb', line 8 def account @account end |
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/akashiyaki/command.rb', line 8 def action @action end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
8 9 10 |
# File 'lib/akashiyaki/command.rb', line 8 def mode @mode end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 |
# File 'lib/akashiyaki/command.rb', line 16 def run client.send(:"#{action}_#{mode}") puts "Succeeded!" rescue NotAuthorized => e puts "Failed! #{e.}" end |