Class: PayPro::Response
- Inherits:
-
Object
- Object
- PayPro::Response
- Defined in:
- lib/pay_pro/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#raw_body ⇒ Object
Returns the value of attribute raw_body.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/pay_pro/response.rb', line 5 def data @data end |
#raw_body ⇒ Object
Returns the value of attribute raw_body.
5 6 7 |
# File 'lib/pay_pro/response.rb', line 5 def raw_body @raw_body end |
#request_id ⇒ Object
Returns the value of attribute request_id.
5 6 7 |
# File 'lib/pay_pro/response.rb', line 5 def request_id @request_id end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/pay_pro/response.rb', line 5 def status @status end |
Class Method Details
.from_response(response_object) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pay_pro/response.rb', line 10 def self.from_response(response_object) response = new response.data = JSON.parse(response_object.body) response.raw_body = response_object.body response.status = response_object.status response.request_id = response_object.headers['x-request-id'] response end |