Module: Sequent::Core::Helpers::MessageHandler::ClassMethods
- Defined in:
- lib/sequent/core/helpers/message_handler.rb
Instance Method Summary collapse
- #handles_message?(message) ⇒ Boolean
- #message_mapping ⇒ Object
- #message_router ⇒ Object
- #on(*args, **opts, &block) ⇒ Object
- #option(name, &block) ⇒ Object
Instance Method Details
#handles_message?(message) ⇒ Boolean
65 66 67 |
# File 'lib/sequent/core/helpers/message_handler.rb', line 65 def () .() end |
#message_mapping ⇒ Object
61 62 63 |
# File 'lib/sequent/core/helpers/message_handler.rb', line 61 def .instanceof_routes end |
#message_router ⇒ Object
69 70 71 |
# File 'lib/sequent/core/helpers/message_handler.rb', line 69 def @message_router ||= MessageRouter.new end |
#on(*args, **opts, &block) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/sequent/core/helpers/message_handler.rb', line 42 def on(*args, **opts, &block) OnArgumentsValidator.validate_arguments!(*args) = args.map { |arg| MessageMatchers::ArgumentCoercer.coerce_argument(arg) } .register_matchers( *, block, ) opts.each do |name, value| option_registry.call_option(self, name, , value) end end |
#option(name, &block) ⇒ Object
57 58 59 |
# File 'lib/sequent/core/helpers/message_handler.rb', line 57 def option(name, &block) option_registry.register_option(name, block) end |