Class: Skink::ResourcefulResponse
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 ResourcefulResponse.
8
9
10
|
# File 'lib/skink/resourceful_client/resourceful_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/resourceful_client/resourceful_response.rb', line 6
def native_response
@native_response
end
|
Instance Method Details
#body ⇒ Object
28
29
30
|
# File 'lib/skink/resourceful_client/resourceful_response.rb', line 28
def body
native_response.body || ""
end
|
#has_status_code?(code) ⇒ Boolean
16
17
18
|
# File 'lib/skink/resourceful_client/resourceful_response.rb', line 16
def has_status_code? code
native_response.code == code
end
|
20
21
22
|
# File 'lib/skink/resourceful_client/resourceful_response.rb', line 20
def
native_response..to_hash
end
|
24
25
26
|
# File 'lib/skink/resourceful_client/resourceful_response.rb', line 24
def
['Link'].join(',')
end
|
#status_code ⇒ Object
12
13
14
|
# File 'lib/skink/resourceful_client/resourceful_response.rb', line 12
def status_code
native_response.code
end
|