Class: Hecks::Runtime::PortOperationInterpreter
- Inherits:
-
Object
- Object
- Hecks::Runtime::PortOperationInterpreter
- Includes:
- CommandInterpreter::ArgumentGate, Interpreting
- Defined in:
- lib/hecks/runtime/port_operation_interpreter.rb
Overview
The dispatch pipeline for a port operation — called by an adapter living
outside the bluebook entirely, never by the domain itself. Deliberately
a trimmed CommandInterpreter: the same payload gate and coercion
(ArgumentGate, Interpreting#normalize_args), but no given, no
mutations, no lifecycle, no save. A port operation does not act on an
aggregate instance — it translates an external call into an event in
this domain's own vocabulary, and whatever mutation follows happens
wherever a policy reacts to that event, exactly as it would for any
command-emitted one.
Defined Under Namespace
Classes: Context
Constant Summary collapse
- DISPATCH_ORDER =
%i[ refuse_unknown_arguments refuse_absent_arguments normalize_args resolve_references resolve_route emit ].freeze
Instance Method Summary collapse
- #call(domain, aggregate, operation, args, route:) ⇒ Object
-
#initialize(registry, rules:) ⇒ PortOperationInterpreter
constructor
A new instance of PortOperationInterpreter.
Methods included from Interpreting
Constructor Details
#initialize(registry, rules:) ⇒ PortOperationInterpreter
Returns a new instance of PortOperationInterpreter.
28 29 30 31 |
# File 'lib/hecks/runtime/port_operation_interpreter.rb', line 28 def initialize(registry, rules:) @registry = registry @rules = rules end |
Instance Method Details
#call(domain, aggregate, operation, args, route:) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/hecks/runtime/port_operation_interpreter.rb', line 33 def call(domain, aggregate, operation, args, route:) ctx = Context.new(domain, aggregate, operation, args) ctx.route = route run_dispatch_order(DISPATCH_ORDER, ctx) ctx.result end |