Class: Afterpay::Error

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

Overview

Error class with accessor to methods Afterpay error returns the same format containing ‘errorId`, `errorCode`, `message`

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
# File 'lib/afterpay/error.rb', line 10

def initialize(response)
  @id = response[:errorId]
  @code = response[:errorCode]
  @message = response[:message]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



8
9
10
# File 'lib/afterpay/error.rb', line 8

def code
  @code
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/afterpay/error.rb', line 8

def id
  @id
end

#messageObject

Returns the value of attribute message.



8
9
10
# File 'lib/afterpay/error.rb', line 8

def message
  @message
end