Module: Trabox::Command

Defined in:
lib/trabox/command.rb,
lib/trabox/command/parser.rb,
lib/trabox/commands/relay.rb,
lib/trabox/commands/subscribe.rb,
lib/trabox/commands/common/runner.rb,
lib/trabox/commands/relay/configuration.rb,
lib/trabox/commands/common/configuration.rb,
lib/trabox/commands/relay/argument_parser.rb,
lib/trabox/commands/subscribe/configuration.rb,
lib/trabox/commands/subscribe/argument_parser.rb

Defined Under Namespace

Modules: Relay, Runner, Subscribe Classes: Configuration, Parser

Class Method Summary collapse

Class Method Details

.invoke(command) ⇒ Object

Parameters:

  • command (String)


8
9
10
11
12
13
14
15
16
17
# File 'lib/trabox/command.rb', line 8

def self.invoke(command)
  case command
  when 'r', 'relay'
    Trabox::Command::Relay.perform
  when 's', 'subscribe'
    Trabox::Command::Subscribe.perform
  else
    raise "no such command: #{command}"
  end
end