Class: Akashiyaki::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/akashiyaki/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, )
  @mode = mode
  @action = action
  @account = 
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



8
9
10
# File 'lib/akashiyaki/command.rb', line 8

def 
  @account
end

#actionObject (readonly)

Returns the value of attribute action.



8
9
10
# File 'lib/akashiyaki/command.rb', line 8

def action
  @action
end

#modeObject (readonly)

Returns the value of attribute mode.



8
9
10
# File 'lib/akashiyaki/command.rb', line 8

def mode
  @mode
end

Instance Method Details

#runObject



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.message}"
end