Class: EventStore::HTTP::ReadEvent::Substitute::ReadEvent
Constant Summary
Error, EventNotFoundError
Instance Attribute Summary collapse
#output_schema
Instance Method Summary
collapse
#build_request, #event_path
included
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
10
11
12
|
# File 'lib/event_store/http/read_event/substitute.rb', line 10
def response
@response
end
|
Instance Method Details
#call(uri = nil, stream: nil, position: nil) ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/event_store/http/read_event/substitute.rb', line 12
def call(uri=nil, stream: nil, position: nil)
uri ||= event_path stream, position
uri = URI(uri)
events.fetch uri.path do
raise EventNotFoundError
end
end
|
#events ⇒ Object
28
29
30
|
# File 'lib/event_store/http/read_event/substitute.rb', line 28
def events
@events ||= {}
end
|
#set_response(event, stream, position) ⇒ Object
22
23
24
25
26
|
# File 'lib/event_store/http/read_event/substitute.rb', line 22
def set_response(event, stream, position)
path = event_path stream, position
events[path] = event
end
|