Module: Rooibos::Message

Defined in:
lib/rooibos/message.rb,
lib/rooibos/message/all.rb,
lib/rooibos/message/open.rb,
lib/rooibos/message/batch.rb,
lib/rooibos/message/clock.rb,
lib/rooibos/message/error.rb,
lib/rooibos/message/timer.rb,
lib/rooibos/message/random.rb,
lib/rooibos/message/routed.rb,
lib/rooibos/message/bubbled.rb,
lib/rooibos/message/canceled.rb,
lib/rooibos/message/system/batch.rb,
lib/rooibos/message/http_response.rb,
lib/rooibos/message/system/stream.rb

Overview

Messages sent from commands to update functions.

All built-in response types live here. Each includes the Predicates mixin for safe predicate calls.

Defined Under Namespace

Modules: Predicates, System Classes: All, Batch, Bubbled, Canceled, Clock, Error, HttpResponse, Open, Random, Routed, Timer

Class Method Summary collapse

Class Method Details

.===(other) ⇒ Object

Matches built-in framework message types for case/when dispatch.

Returns true only for classes under Rooibos::Message::. Rejects key events and user-defined message classes.

Example

case message
when Rooibos::Message
  handle_command_response(message)
when RatatuiRuby::Event::Key
  handle_key(message)
end


27
28
29
# File 'lib/rooibos/message.rb', line 27

def self.===(other)
  other.class.name&.start_with?("Rooibos::Message::")
end