Class: EventStoreRuby::EventRecord
- Defined in:
- lib/eventstore_ruby/event.rb
Overview
Persisted event enriched with sequence number and timestamp.
Instance Attribute Summary collapse
-
#sequence_number ⇒ Object
readonly
Returns the value of attribute sequence_number.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(sequence_number:, timestamp: Time.now, event_type:, payload: {}) ⇒ EventRecord
constructor
A new instance of EventRecord.
Constructor Details
#initialize(sequence_number:, timestamp: Time.now, event_type:, payload: {}) ⇒ EventRecord
18 19 20 21 22 |
# File 'lib/eventstore_ruby/event.rb', line 18 def initialize(sequence_number:, timestamp: Time.now, event_type:, payload: {}) @sequence_number = Integer(sequence_number) = super(event_type: event_type, payload: payload) end |
Instance Attribute Details
#sequence_number ⇒ Object (readonly)
Returns the value of attribute sequence_number.
16 17 18 |
# File 'lib/eventstore_ruby/event.rb', line 16 def sequence_number @sequence_number end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
16 17 18 |
# File 'lib/eventstore_ruby/event.rb', line 16 def end |