Class: Igniter::Contracts::Execution::EffectInvocation
- Inherits:
-
Object
- Object
- Igniter::Contracts::Execution::EffectInvocation
- Defined in:
- lib/igniter/contracts/execution/effect_invocation.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
Instance Method Summary collapse
-
#initialize(payload:, context:, profile:) ⇒ EffectInvocation
constructor
A new instance of EffectInvocation.
- #to_h ⇒ Object
Constructor Details
#initialize(payload:, context:, profile:) ⇒ EffectInvocation
Returns a new instance of EffectInvocation.
9 10 11 12 13 14 |
# File 'lib/igniter/contracts/execution/effect_invocation.rb', line 9 def initialize(payload:, context:, profile:) @payload = payload @context = context.is_a?(NamedValues) ? context : NamedValues.new(context) @profile = profile freeze end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/igniter/contracts/execution/effect_invocation.rb', line 7 def context @context end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
7 8 9 |
# File 'lib/igniter/contracts/execution/effect_invocation.rb', line 7 def payload @payload end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
7 8 9 |
# File 'lib/igniter/contracts/execution/effect_invocation.rb', line 7 def profile @profile end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/igniter/contracts/execution/effect_invocation.rb', line 16 def to_h { payload: StructuredDump.dump(payload), context: context.to_h, profile_fingerprint: profile.fingerprint } end |