Class: Rooibos::Router::Flow::Inward
- Inherits:
-
Object
- Object
- Rooibos::Router::Flow::Inward
- Includes:
- Dispatch
- Defined in:
- lib/rooibos/router/flow/inward.rb
Overview
Inward flow: messages traveling toward the leaves.
Observe → receive → forward → otherwise.
Instance Method Summary collapse
- #call(message, model) ⇒ Object
-
#initialize(observes:, receives:, forwards:, otherwises:, routes:) ⇒ Inward
constructor
A new instance of Inward.
Constructor Details
#initialize(observes:, receives:, forwards:, otherwises:, routes:) ⇒ Inward
Returns a new instance of Inward.
19 20 21 22 |
# File 'lib/rooibos/router/flow/inward.rb', line 19 def initialize(observes:, receives:, forwards:, otherwises:, routes:) super validate_routes! end |
Instance Method Details
#call(message, model) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/rooibos/router/flow/inward.rb', line 24 def call(, model) transition = run_all(observes, , model) config = Configuration.new(message:, model: transition.model) apply_first_matching(receives, config, transition) || apply_first_matching(forwards, config, transition) || apply_first_matching(otherwises, config, transition) || transition end |