Exception: Eddy::Errors::LengthValidationError
- Inherits:
-
ElementValidationError
- Object
- StandardError
- Error
- ElementValidationError
- Eddy::Errors::LengthValidationError
- Defined in:
- lib/eddy/errors.rb
Overview
Exception raised when an invalid argument is passed to the value=
method of an Models::Element::Base class.
Instance Attribute Summary
Attributes inherited from ElementValidationError
Element Validation Errors collapse
- #initialize(msg = "", element:, arg:) ⇒ void constructor
Methods inherited from ElementValidationError
Constructor Details
#initialize(msg = "", element:, arg:) ⇒ void
91 92 93 94 95 96 97 98 99 |
# File 'lib/eddy/errors.rb', line 91 def initialize(msg = "", element:, arg:) self.element = element self.arg = arg if msg.length == 0 msg << "Value can't be longer than #{self.element.max}. " msg << "Length of recieved value: #{self.arg.to_s.length}" end super(msg) end |