Class: Judopay::FieldError

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

Overview

Single field error model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code, field_name, detail) ⇒ FieldError

Returns a new instance of FieldError.



8
9
10
11
12
13
# File 'lib/judopay/error.rb', line 8

def initialize(message, code, field_name, detail)
  @detail = detail
  @field_name = field_name
  @code = code
  @message = message
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



6
7
8
# File 'lib/judopay/error.rb', line 6

def code
  @code
end

#detailObject

Returns the value of attribute detail.



6
7
8
# File 'lib/judopay/error.rb', line 6

def detail
  @detail
end

#field_nameObject

Returns the value of attribute field_name.



6
7
8
# File 'lib/judopay/error.rb', line 6

def field_name
  @field_name
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/judopay/error.rb', line 6

def message
  @message
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/judopay/error.rb', line 15

def to_s
  "Field \"#{@field_name}\" (code #{@code}): #{@message}"
end