Class: EventStoreRuby::Event
- Inherits:
-
Object
- Object
- EventStoreRuby::Event
- Defined in:
- lib/eventstore_ruby/event.rb
Overview
Base application-level event. Immutable: attributes are frozen after initialization.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(event_type:, payload: {}) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(event_type:, payload: {}) ⇒ Event
Returns a new instance of Event.
7 8 9 10 11 |
# File 'lib/eventstore_ruby/event.rb', line 7 def initialize(event_type:, payload: {}) @event_type = event_type.to_s.freeze @payload = payload.freeze freeze end |
Instance Attribute Details
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
5 6 7 |
# File 'lib/eventstore_ruby/event.rb', line 5 def event_type @event_type end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
5 6 7 |
# File 'lib/eventstore_ruby/event.rb', line 5 def payload @payload end |