Method: Cognition::Matcher#run

Defined in:
lib/cognition/matcher.rb

#run(msg) ⇒ Object



24
25
26
27
28
# File 'lib/cognition/matcher.rb', line 24

def run(msg)
  @response = action.call(msg, match_data).to_s
rescue => e
  @response = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"
end