Exception: Pin::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/pin-payments.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



16
17
18
19
20
21
# File 'lib/pin-payments.rb', line 16

def initialize(response)
  @code = response.code
  @error = response['error']
  @description = response['description']
  @response = response
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#errorObject (readonly)

Returns the value of attribute error.



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

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/pin-payments.rb', line 23

def to_s
  "#{@code} #{@error} #{@description}"
end