Method: Ego::Handler#handle
- Defined in:
- lib/ego/handler.rb
#handle(query) ⇒ false, Array
Match the given query against the condition.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ego/handler.rb', line 62 def handle(query) return false unless (result = @condition.call(query)) @action.parameters.each_with_object([]) do |param, arr| begin arr << result[param.pop] rescue IndexError arr << nil # Match group isn't defined. end end end |