Class: Omnes::UnstructuredEvent
- Inherits:
-
Object
- Object
- Omnes::UnstructuredEvent
- Defined in:
- lib/omnes/unstructured_event.rb
Overview
Event with a payload defined at publication time
An instance of it is automatically created on Bus#publish when a name and payload are given.
Instance Attribute Summary collapse
-
#omnes_event_name ⇒ Symbol
readonly
Name of the event.
-
#payload ⇒ Hash
readonly
Information made available to the matching subscriptions.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Delegates to #payload.
-
#initialize(payload:, omnes_event_name:) ⇒ UnstructuredEvent
constructor
private
A new instance of UnstructuredEvent.
Constructor Details
#initialize(payload:, omnes_event_name:) ⇒ UnstructuredEvent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of UnstructuredEvent.
28 29 30 31 |
# File 'lib/omnes/unstructured_event.rb', line 28 def initialize(payload:, omnes_event_name:) @payload = payload @omnes_event_name = omnes_event_name end |
Instance Attribute Details
#omnes_event_name ⇒ Symbol (readonly)
Name of the event
20 21 22 |
# File 'lib/omnes/unstructured_event.rb', line 20 def omnes_event_name @omnes_event_name end |
#payload ⇒ Hash (readonly)
Information made available to the matching subscriptions
25 26 27 |
# File 'lib/omnes/unstructured_event.rb', line 25 def payload @payload end |
Instance Method Details
#[](key) ⇒ Object
Delegates to #payload
38 39 40 |
# File 'lib/omnes/unstructured_event.rb', line 38 def [](key) payload[key] end |