Class: HttpEventStore::Actions::ReadProjectionState

Inherits:
Object
  • Object
show all
Defined in:
lib/http_event_store/actions/read_projection_state.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ReadProjectionState

Returns a new instance of ReadProjectionState.


5
6
7
# File 'lib/http_event_store/actions/read_projection_state.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#call(projection_name) ⇒ Object


9
10
11
12
13
14
15
# File 'lib/http_event_store/actions/read_projection_state.rb', line 9

def call(projection_name)
  response = get_projection_state(projection_name)
  return_state(response)
rescue ClientError => e
  raise StreamAlreadyDeleted if e.code == 410
  raise StreamNotFound if e.code == 404
end