Class: PinchHitter::Service::EndpointRecorders
- Inherits:
-
Object
- Object
- PinchHitter::Service::EndpointRecorders
- Defined in:
- lib/pinch_hitter/service/endpoint_recorders.rb
Instance Method Summary collapse
- #record(endpoint, request) ⇒ Object
- #recorder_for(endpoint = '/') ⇒ Object
- #recorders ⇒ Object
- #requests(endpoint) ⇒ Object
- #reset ⇒ Object
Instance Method Details
#record(endpoint, request) ⇒ Object
7 8 9 |
# File 'lib/pinch_hitter/service/endpoint_recorders.rb', line 7 def record(endpoint, request) recorder_for(endpoint) << request end |
#recorder_for(endpoint = '/') ⇒ Object
15 16 17 |
# File 'lib/pinch_hitter/service/endpoint_recorders.rb', line 15 def recorder_for(endpoint='/') recorders[endpoint] ||= [] end |
#recorders ⇒ Object
3 4 5 |
# File 'lib/pinch_hitter/service/endpoint_recorders.rb', line 3 def recorders @recorders ||= {} end |
#requests(endpoint) ⇒ Object
11 12 13 |
# File 'lib/pinch_hitter/service/endpoint_recorders.rb', line 11 def requests(endpoint) recorder_for(endpoint) end |
#reset ⇒ Object
19 20 21 |
# File 'lib/pinch_hitter/service/endpoint_recorders.rb', line 19 def reset recorders.clear end |