Class: Skink::RackTestResponse
- Inherits:
-
Client::Response
- Object
- Client::Response
- Skink::RackTestResponse
- Defined in:
- lib/skink/rack_test_client/rack_test_response.rb
Instance Attribute Summary collapse
-
#native_response ⇒ Object
readonly
Returns the value of attribute native_response.
Instance Method Summary collapse
- #body ⇒ Object
- #has_status_code?(code) ⇒ Boolean
- #headers ⇒ Object
-
#initialize(native_response) ⇒ RackTestResponse
constructor
A new instance of RackTestResponse.
- #status_code ⇒ Object
Methods inherited from Client::Response
#find_header, #has_header?, #has_jsonpath?, #has_xpath?, #json_doc, #jsonpath, #method_missing, #xml_doc, #xpath
Methods included from Client::Utils
Constructor Details
#initialize(native_response) ⇒ RackTestResponse
Returns a new instance of RackTestResponse.
8 9 10 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 8 def initialize(native_response) @native_response = native_response end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Skink::Client::Response
Instance Attribute Details
#native_response ⇒ Object (readonly)
Returns the value of attribute native_response.
6 7 8 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 6 def native_response @native_response end |
Instance Method Details
#body ⇒ Object
28 29 30 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 28 def body native_response.body end |
#has_status_code?(code) ⇒ Boolean
16 17 18 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 16 def has_status_code? code native_response.status == code end |
#headers ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 20 def headers if native_response.is_a? Rack::Response native_response.header else native_response.headers end end |
#status_code ⇒ Object
12 13 14 |
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 12 def status_code native_response.status end |