Class: HttpEventstore::Actions::ReadAllStreamEvents
- Inherits:
-
Object
- Object
- HttpEventstore::Actions::ReadAllStreamEvents
- Defined in:
- lib/http_eventstore/actions/read_all_stream_events.rb
Direct Known Subclasses
Instance Method Summary collapse
- #call(stream_name) ⇒ Object
-
#initialize(client) ⇒ ReadAllStreamEvents
constructor
A new instance of ReadAllStreamEvents.
Constructor Details
#initialize(client) ⇒ ReadAllStreamEvents
Returns a new instance of ReadAllStreamEvents.
5 6 7 |
# File 'lib/http_eventstore/actions/read_all_stream_events.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#call(stream_name) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/http_eventstore/actions/read_all_stream_events.rb', line 9 def call(stream_name) raise IncorrectStreamData if stream_name.nil? || stream_name.empty? entries = get_all_stream_entries(stream_name) return_events(entries) rescue ClientError => e raise StreamAlreadyDeleted if e.code == 410 raise StreamNotFound if e.code == 404 end |