Class: Jank::Command
- Inherits:
-
Object
- Object
- Jank::Command
- Defined in:
- lib/command.rb
Direct Known Subclasses
GoCommand, GocodeCommand, GodocCommand, GofmtCommand, GoimportsCommand, GolintCommand, JankCommand
Instance Method Summary collapse
- #dispatch ⇒ Object
-
#initialize(args, config, janker, executor) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(args, config, janker, executor) ⇒ Command
Returns a new instance of Command.
3 4 5 6 7 8 |
# File 'lib/command.rb', line 3 def initialize(args, config, janker, executor) @config = config @janker = janker @exec = executor @args = args end |
Instance Method Details
#dispatch ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/command.rb', line 10 def dispatch command = "#{@args[0]}_command" if !self.respond_to? command command = 'help' end self.send(command) end |