Class: AocCli::Interface::Query
- Inherits:
-
Object
- Object
- AocCli::Interface::Query
- Defined in:
- lib/aoc_cli/interface.rb
Instance Method Summary collapse
-
#initialize ⇒ Query
constructor
A new instance of Query.
- #run(args:) ⇒ Object
Constructor Details
#initialize ⇒ Query
Returns a new instance of Query.
4 5 6 7 8 9 |
# File 'lib/aoc_cli/interface.rb', line 4 def initialize ARGV.size > 0 ? run(args:Args.new.parse) : Help.print rescue StandardError => e abort e. end |
Instance Method Details
#run(args:) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/aoc_cli/interface.rb', line 10 def run(args:) cmd = Commands.const_get(Validate.cmd(args.cmd)) .new(args.args).exec cmd.respond if cmd.class .instance_methods.include?(:respond) end |