Exception: Yapo::Helpers::CustomErrors::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yapo/helpers/custom_errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception = nil, msg) ⇒ ValidationError

Returns a new instance of ValidationError.



20
21
22
23
# File 'lib/yapo/helpers/custom_errors.rb', line 20

def initialize(exception = nil, msg)
  @original = exception
  ErrorMessage.new.print(message(msg))
end

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



18
19
20
# File 'lib/yapo/helpers/custom_errors.rb', line 18

def original
  @original
end

Instance Method Details

#message(msg = nil) ⇒ Object



25
26
27
# File 'lib/yapo/helpers/custom_errors.rb', line 25

def message(msg = nil)
  "#{msg}\n"
end