class GmoPayment::Errors::ResponseHasErrCodeError

Error of response body has “ErrCode”.

Attributes

called_method[RW]

@!attribute [rw] called_method @!attribute [rw] response

response[RW]

@!attribute [rw] called_method @!attribute [rw] response

Public Class Methods

new(called_method = nil, response = nil) click to toggle source

@param [Symbol] called_method @param [Response] response

Calls superclass method
# File lib/gmo_payment/errors.rb, line 77
def initialize(called_method = nil, response = nil)
  self.called_method = called_method
  self.response = response
  super("HTTP response called from `#{called_method}' has ErrCode")
end

Public Instance Methods

error_messages(file = nil) click to toggle source

@param [String] file @return [Hash]

# File lib/gmo_payment/errors.rb, line 85
def error_messages(file = nil)
  require 'yaml'
  error_list = YAML.load_file(file || GmoPayment::Configure.error_list)
  self.response.err_info.each_with_object({}) do |error, hash|
    hash[error] = error_list[error]
  end
end