Class: RubyEventStore::Browser::GetEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/browser/get_event.rb

Instance Method Summary collapse

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_hObject



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