lib/rubo/robot.rb
# Passes the given message to any interested Listeners.
#
# @param message [Message] A Message instance.
#   Listeners can flag this message as 'done' to prevent further execution.
# @return [void]
Passes the given message to any interested Listeners.
Passes the given message to any interested Listeners .
def receive(message)
      results = []
      @listeners.each do |listener|
        begin
          results.push(listener.call(message))
          break if message.done?
        rescue => e
          emit(:error, e, @response.new(self, message, []))
        end
      end
      if !message.is_a?(CatchAllMessage) && !results.index(true) == -1
        receive(CatchAllMessage.new(message))
      end
    end
def receive ( message ) results = [ ] @listeners . each do | listener | begin results . push ( listener . call ( message ) ) break if message . done? rescue => e emit ( :error , e , @response . new ( self , message , [ ] ) ) end end if ! message . is_a? ( CatchAllMessage ) && ! results . index ( true ) == - 1 receive ( CatchAllMessage . new ( message ) ) end end
Passes the given message to any interested Listeners.
Passes the given message to any interested Listeners .
None
void
message
A Message instance. Listeners can flag this message as 'done' to prevent further execution.
A Message instance . Listeners can flag this message as ' done ' to prevent further execution .