Method: Lita::Robot#receive

Defined in:
lib/lita/robot.rb

#receive(message) ⇒ void

This method returns an undefined value.

The primary entry point from the adapter for an incoming message. Dispatches the message to all registered handlers.

Parameters:



65
66
67
68
69
70
71
72
73
# File 'lib/lita/robot.rb', line 65

def receive(message)
  matched = handlers.map do |handler|
    next unless handler.respond_to?(:dispatch)

    handler.dispatch(self, message)
  end.any?

  trigger(:unhandled_message, message: message) unless matched
end