class GoCardlessPro::Response
A class to wrap an API response
Public Class Methods
Source
# File lib/gocardless_pro/response.rb, line 11 def initialize(response) @response = response end
Initialize a response instance @param response an API response
Public Instance Methods
Source
# File lib/gocardless_pro/response.rb, line 16 def body JSON.parse(@response.body) unless @response.body.empty? end
Return the body of parsed JSON body of the API response
Source
# File lib/gocardless_pro/response.rb, line 26 def limit meta.fetch('limit', nil) end
Returns the limit parameter from the response
Source
# File lib/gocardless_pro/response.rb, line 21 def meta json_body.fetch('meta', {}) end
Returns the meta hash of the response