Class: WellsFargo::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/wells_fargo/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_responseObject (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

#bodyObject



18
19
20
# File 'lib/wells_fargo/response.rb', line 18

def body
  @body ||= JSON.parse(raw_response.body, symbolize: true)
end

#success?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/wells_fargo/response.rb', line 22

def success?
  !body.key?(:errors)
end