class SelfPay::Response

Public Class Methods

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

Public Instance Methods

client_error?() click to toggle source
# File lib/SelfPay/response.rb, line 15
def client_error?
  (400..499).cover? @resp.code.to_i
end
success?() click to toggle source
# File lib/SelfPay/response.rb, line 11
def success?
  (200..299).cover? @resp.code.to_i
end