Method: Consoler::Application#method_missing
- Defined in:
- lib/consoler/application.rb
#method_missing(command_name, input = nil) {|...| ... } ⇒ nil
Register a command for this app
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/consoler/application.rb', line 57 def method_missing(command_name, input = nil, &block) action = nil = '' unless block.nil? action = block = input if !.nil? && !.instance_of?(String) raise 'Invalid options' end end if input.instance_of? Consoler::Application action = input = '' end if action.nil? raise 'Invalid subapp/block' end command = command_name.to_s _add_command(command, , action) nil end |