Class: WebfleetConnect::Response
- Inherits:
-
Object
- Object
- WebfleetConnect::Response
- Defined in:
- lib/webfleet_connect/response.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(response, url, is_json) ⇒ Response
constructor
A new instance of Response.
- #status_code ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response, url, is_json) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 |
# File 'lib/webfleet_connect/response.rb', line 8 def initialize(response, url, is_json) @response = response @url = url @parser = build_parser(is_json) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/webfleet_connect/response.rb', line 6 def url @url end |
Instance Method Details
#status_code ⇒ Object
14 15 16 |
# File 'lib/webfleet_connect/response.rb', line 14 def status_code @response.code end |
#to_hash ⇒ Object
18 19 20 |
# File 'lib/webfleet_connect/response.rb', line 18 def to_hash @parser.to_hash(@response.body) end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/webfleet_connect/response.rb', line 22 def to_s @response.body end |