Class: RideBuilder::Affiliate::Response
- Inherits:
-
Struct
- Object
- Struct
- RideBuilder::Affiliate::Response
- Defined in:
- lib/ridebuilder/affiliate/transport.rb
Overview
A completed HTTP response — any status. Non-2xx is returned here, not raised.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
13 14 15 |
# File 'lib/ridebuilder/affiliate/transport.rb', line 13 def body @body end |
#status ⇒ Object
Returns the value of attribute status
13 14 15 |
# File 'lib/ridebuilder/affiliate/transport.rb', line 13 def status @status end |
Instance Method Details
#json ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ridebuilder/affiliate/transport.rb', line 14 def json return nil if body.nil? || body.empty? JSON.parse(body) rescue JSON::ParserError nil end |