Module: TimerCli::Command::Dispatcher

Included in:
TimerCli::Command
Defined in:
lib/timer_cli/command/dispatcher.rb

Overview

timer commands dispatcher

Instance Method Summary collapse

Instance Method Details

#dispatchObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/timer_cli/command/dispatcher.rb', line 10

def dispatch
  parse

  if help?
    print help
  elsif errors?
    puts params.errors.summary
  else
    TimerCli::Command::TimerCommand.execute(params)
  end
end