Class: Takoyaki::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/takoyaki/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = []) ⇒ Runner



14
15
16
# File 'lib/takoyaki/runner.rb', line 14

def initialize(args = [])
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



12
13
14
# File 'lib/takoyaki/runner.rb', line 12

def args
  @args
end

Instance Method Details

#commandObject



27
28
29
# File 'lib/takoyaki/runner.rb', line 27

def command
  args.first
end

#runObject



18
19
20
21
22
23
24
25
# File 'lib/takoyaki/runner.rb', line 18

def run
  case command
  when "activities"
    Commands::Activities.new.execute
  when "reviews"
    Commands::Reviews.new(*args[1..-1]).execute
  end
end