Class: Skink::RackTestResponse
Instance Attribute Summary collapse
Instance Method Summary
collapse
#find_header, #has_header?, #has_jsonpath?, #has_link_header?, #has_xpath?, #json_doc, #jsonpath, #links, #method_missing, #xml_doc, #xpath
#normalize_header_name
Constructor Details
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
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
32
33
34
|
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 32
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
|
20
21
22
23
24
25
26
|
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 20
def
if native_response.is_a? Rack::Response
native_response.
else
native_response.
end
end
|
28
29
30
|
# File 'lib/skink/rack_test_client/rack_test_response.rb', line 28
def
["Link"]
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
|