Class: ReqWrap::HttpFeatures::ResponseStore

Inherits:
HTTP::Feature
  • Object
show all
Defined in:
lib/req_wrap/http_features/response_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(store:) ⇒ ResponseStore

Returns a new instance of ResponseStore.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
# File 'lib/req_wrap/http_features/response_store.rb', line 8

def initialize(store:)
  super()

  raise ArgumentError, 'Provide data structure to store responses' unless store

  @store = store
end

Instance Method Details

#wrap_response(response) ⇒ Object



16
17
18
19
20
# File 'lib/req_wrap/http_features/response_store.rb', line 16

def wrap_response(response)
  @store.append(response)

  response
end