Class: TreezorConnect::TreezorResponse
- Inherits:
-
Object
- Object
- TreezorConnect::TreezorResponse
- Defined in:
- lib/treezor_connect/treezor_response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#http_body ⇒ Object
Returns the value of attribute http_body.
-
#http_headers ⇒ Object
Returns the value of attribute http_headers.
-
#http_status ⇒ Object
Returns the value of attribute http_status.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/treezor_connect/treezor_response.rb', line 5 def data @data end |
#http_body ⇒ Object
Returns the value of attribute http_body.
5 6 7 |
# File 'lib/treezor_connect/treezor_response.rb', line 5 def http_body @http_body end |
#http_headers ⇒ Object
Returns the value of attribute http_headers.
5 6 7 |
# File 'lib/treezor_connect/treezor_response.rb', line 5 def http_headers @http_headers end |
#http_status ⇒ Object
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/treezor_connect/treezor_response.rb', line 5 def http_status @http_status end |
Class Method Details
.from_http_response(http_resp) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/treezor_connect/treezor_response.rb', line 7 def self.from_http_response(http_resp) resp = TreezorResponse.new resp.data = JSON.parse(http_resp.body) if http_resp.body.to_s != '' resp.http_body = http_resp.body resp.http_headers = http_resp.headers resp.http_status = http_resp.status resp end |