Class: Faraday::Adapter::MockRequest::Stub
- Defined in:
- lib/faraday/adapter/mock_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#path ⇒ Object
Returns the value of attribute path.
-
#request_headers ⇒ Object
Returns the value of attribute request_headers.
-
#response_headers ⇒ Object
Returns the value of attribute response_headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
35 36 37 |
# File 'lib/faraday/adapter/mock_request.rb', line 35 def body @body end |
#path ⇒ Object
Returns the value of attribute path
35 36 37 |
# File 'lib/faraday/adapter/mock_request.rb', line 35 def path @path end |
#request_headers ⇒ Object
Returns the value of attribute request_headers
35 36 37 |
# File 'lib/faraday/adapter/mock_request.rb', line 35 def request_headers @request_headers end |
#response_headers ⇒ Object
Returns the value of attribute response_headers
35 36 37 |
# File 'lib/faraday/adapter/mock_request.rb', line 35 def response_headers @response_headers end |
#status ⇒ Object
Returns the value of attribute status
35 36 37 |
# File 'lib/faraday/adapter/mock_request.rb', line 35 def status @status end |
Instance Method Details
#matches?(request_path, headers) ⇒ Boolean
36 37 38 39 40 41 42 43 |
# File 'lib/faraday/adapter/mock_request.rb', line 36 def matches?(request_path, headers) return false if request_path != path return true if request_headers.empty? request_headers.each do |key, value| return true if headers[key] == value end false end |