Class: WellsFargo::Response
- Inherits:
-
Object
- Object
- WellsFargo::Response
- Extended by:
- Forwardable
- Defined in:
- lib/wells_fargo/response.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(raw_response) ⇒ Response
Returns a new instance of Response.
14 15 16 |
# File 'lib/wells_fargo/response.rb', line 14 def initialize(raw_response) @raw_response = raw_response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
10 11 12 |
# File 'lib/wells_fargo/response.rb', line 10 def raw_response @raw_response end |
Instance Method Details
#body ⇒ Object
18 19 20 |
# File 'lib/wells_fargo/response.rb', line 18 def body @body ||= JSON.parse(raw_response.body, symbolize: true) end |
#success? ⇒ Boolean
22 23 24 |
# File 'lib/wells_fargo/response.rb', line 22 def success? !body.key?(:errors) end |