Class: RubyEventStore::Browser::JsonApiStream
- Inherits:
-
Object
- Object
- RubyEventStore::Browser::JsonApiStream
- Defined in:
- lib/ruby_event_store/browser/json_api_stream.rb
Instance Method Summary collapse
-
#initialize(stream_name, events_from_stream_url, related_streams) ⇒ JsonApiStream
constructor
A new instance of JsonApiStream.
- #to_h ⇒ Object
Constructor Details
#initialize(stream_name, events_from_stream_url, related_streams) ⇒ JsonApiStream
Returns a new instance of JsonApiStream.
6 7 8 9 10 |
# File 'lib/ruby_event_store/browser/json_api_stream.rb', line 6 def initialize(stream_name, events_from_stream_url, ) @stream_name = stream_name @events_from_stream_url = events_from_stream_url @related_streams = end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ruby_event_store/browser/json_api_stream.rb', line 12 def to_h { id: stream_name, type: "streams", attributes: { related_streams: }, relationships: { events: { links: { self: events_from_stream_url } } } } end |