class BridgeBankin::API::Error

Error is the base error from which all other more specific BridgeBankin errors derive.

Attributes

code[R]
documentation_url[R]
payload[R]
type[R]

Public Class Methods

new(code, response_body = {}) click to toggle source

Initializes Error

@param [String] code the HTTP code returned by the API @param [Hash] response_body the parsed API response @option response_body [String] :type the machine readable error message @option response_body [String] :message the human readable error message @option response_body [String] :documentation_url the optional link to documentation

Calls superclass method
# File lib/bridge_bankin/api/error.rb, line 18
def initialize(code, response_body = {})
  @payload = response_body
  @code = code
  @type = payload[:type]
  @documentation_url = payload[:documentation_url]

  super(payload[:message])
end