class MoneyMover::Dwolla::ApiServerResponse
Attributes
response[R]
Public Class Methods
new(response)
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 6 def initialize(response) @response = response end
Public Instance Methods
body()
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 10 def body HashWithIndifferentAccess.new @response.body end
errors()
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 14 def errors @errors ||= ErrorHandler.new(body).errors end
resource_id()
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 26 def resource_id resource_location.split('/').last rescue nil end
resource_location()
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 22 def resource_location @response.headers[:location] if @response.headers[:location] end
success?()
click to toggle source
# File lib/money_mover/dwolla/api_server_response.rb, line 18 def success? @response.status >= 200 && @response.status < 400 end