Exception: Pin::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pin/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ Error

Returns a new instance of Error.



16
17
18
19
# File 'lib/pin/error.rb', line 16

def initialize code, message
  @code = code
  @message = message
end

Instance Attribute Details

#codeObject

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



14
15
16
# File 'lib/pin/error.rb', line 14

def code
  @code
end

#messageObject

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



14
15
16
# File 'lib/pin/error.rb', line 14

def message
  @message
end

Instance Method Details

#to_sObject



25
26
27
# File 'lib/pin/error.rb', line 25

def to_s
  message
end