class Pin::Error

Attributes

json_body[RW]

Possible Responses

200 - (OK) Successful request 422 - (invalid_resource) One or more parameters were missing or invalid 400 - (card_declined) The card was declined 400 - (insufficient_funds) Bad api_key or not authorized to access a resource. 400 - (suspected_fraud) The resource requested doesn’t exist. 400 - (expired_card) Clever screwed up. 404 - (resource_not_found) No resource was found at this URL. 500 - Server errors

status[RW]

Possible Responses

200 - (OK) Successful request 422 - (invalid_resource) One or more parameters were missing or invalid 400 - (card_declined) The card was declined 400 - (insufficient_funds) Bad api_key or not authorized to access a resource. 400 - (suspected_fraud) The resource requested doesn’t exist. 400 - (expired_card) Clever screwed up. 404 - (resource_not_found) No resource was found at this URL. 500 - Server errors

Public Class Methods

new(status, json_body) click to toggle source
# File lib/pin/error.rb, line 18
def initialize(status, json_body)
  @status = status
  @json_body = JSON.parse(json_body)
end

Public Instance Methods

details() click to toggle source
# File lib/pin/error.rb, line 31
def details
  @json_body
end
error() click to toggle source
# File lib/pin/error.rb, line 23
def error
  @json_body['error']
end
error_description() click to toggle source
# File lib/pin/error.rb, line 27
def error_description
  @json_body['error_description']
end
to_s() click to toggle source
# File lib/pin/error.rb, line 35
def to_s
  "HTTP Error #{@status}: #{error}"
end