Class: Aric::Command

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

Instance Method Summary collapse

Constructor Details

#initialize(args = ARGV) ⇒ Command

Returns a new instance of Command.

[View source]

9
10
11
# File 'lib/aric/command.rb', line 9

def initialize(args = ARGV)
  @args = args
end

Instance Method Details

#callObject

[View source]

13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/aric/command.rb', line 13

def call
  case
  when list?
    puts job_list
  when play?
    play
  else
    puts run
  end
rescue Aric::Error::JobNameRequired, Aric::Error::JobNotFound, Aric::Error::ScriptExecutionError => e
  puts "Error: #{e}"
end