Class: MasterCard::Core::Exceptions::FieldError

Inherits:
Object
  • Object
show all
Defined in:
lib/mastercard/core/exceptions.rb

Overview

FieldError

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ FieldError

Returns a new instance of FieldError.



299
300
301
302
303
304
# File 'lib/mastercard/core/exceptions.rb', line 299

def initialize(params)

  @name    = params.fetch("field","")
  @message = params.fetch("message","")
  @code    = params.fetch("code")
end

Instance Method Details

#getErrorCodeObject



314
315
316
# File 'lib/mastercard/core/exceptions.rb', line 314

def getErrorCode
  return @code
end

#getErrorMessageObject



310
311
312
# File 'lib/mastercard/core/exceptions.rb', line 310

def getErrorMessage
  return @message
end

#getFieldNameObject



306
307
308
# File 'lib/mastercard/core/exceptions.rb', line 306

def getFieldName
  return @name
end

#to_sObject



318
319
320
# File 'lib/mastercard/core/exceptions.rb', line 318

def to_s
  return "Field Error: #{@name} \"#{@message}\" (#{@code})"
end