Class: Hivent::CLI::Runner
- Inherits:
-
Object
- Object
- Hivent::CLI::Runner
- Defined in:
- lib/hivent/cli/runner.rb
Constant Summary collapse
- OPTION_PARSERS =
{ start: StartOptionParser }.freeze
Instance Method Summary collapse
-
#initialize(argv) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ Runner
Returns a new instance of Runner.
19 20 21 22 |
# File 'lib/hivent/cli/runner.rb', line 19 def initialize(argv) @argv = argv @command = @argv.shift.to_s.to_sym end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/hivent/cli/runner.rb', line 24 def run if parser = OPTION_PARSERS[@command] send(@command, parser.new(@command, @argv).parse) else puts help end end |