Class: RubyEventStore::Browser::GetEvent
- Inherits:
-
Object
- Object
- RubyEventStore::Browser::GetEvent
- Defined in:
- lib/ruby_event_store/browser/get_event.rb
Instance Method Summary collapse
-
#initialize(event_store:, event_id:) ⇒ GetEvent
constructor
A new instance of GetEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(event_store:, event_id:) ⇒ GetEvent
Returns a new instance of GetEvent.
6 7 8 9 |
# File 'lib/ruby_event_store/browser/get_event.rb', line 6 def initialize(event_store:, event_id:) @event_store = event_store @event_id = event_id end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/ruby_event_store/browser/get_event.rb', line 11 def to_h { data: [ JsonApiEvent.new(event, parent_event_id).to_h, { relationships: { streams: { data: streams } } } ].reduce(&:merge) } end |