class Incentivale::Response

Public Class Methods

new(response) click to toggle source
Calls superclass method
# File lib/incentivale/response.rb, line 3
def initialize(response)
  @response = response
  if json.is_a?(Hash)
    super(RecursiveOpenStruct.new(json, recurse_over_arrays: true))
  else
    super(@response.body)
  end
  @response
end

Public Instance Methods

json() click to toggle source
# File lib/incentivale/response.rb, line 13
def json
  @json ||= JSON.parse(@response.body).to_snake_keys
end