Class: RubyEventStore::Browser::GetEventsFromStream
- Inherits:
-
Object
- Object
- RubyEventStore::Browser::GetEventsFromStream
- Defined in:
- lib/ruby_event_store/browser/get_events_from_stream.rb
Constant Summary collapse
- HEAD =
Object.new
Instance Method Summary collapse
-
#initialize(event_store:, routing:, stream_name:, page:) ⇒ GetEventsFromStream
constructor
A new instance of GetEventsFromStream.
- #to_h ⇒ Object
Constructor Details
#initialize(event_store:, routing:, stream_name:, page:) ⇒ GetEventsFromStream
Returns a new instance of GetEventsFromStream.
8 9 10 11 12 13 |
# File 'lib/ruby_event_store/browser/get_events_from_stream.rb', line 8 def initialize(event_store:, routing:, stream_name:, page:) @event_store = event_store @routing = routing @stream_name = stream_name @page = page || {} end |
Instance Method Details
#to_h ⇒ Object
15 16 17 |
# File 'lib/ruby_event_store/browser/get_events_from_stream.rb', line 15 def to_h { data: events.map { |e| JsonApiEvent.new(e, nil).to_h }, links: links } end |