Exception: Modulorails::InvalidValueError
- Defined in:
- lib/modulorails/errors/invalid_value_error.rb
Overview
An exception representing an invalid value for a given field.
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#r field(field) ⇒ Object
The name of the field that had a wrong value.
Instance Method Summary collapse
-
#initialize(field) ⇒ InvalidValueError
constructor
A new instance of InvalidValueError.
Constructor Details
#initialize(field) ⇒ InvalidValueError
Returns a new instance of InvalidValueError.
10 11 12 13 14 |
# File 'lib/modulorails/errors/invalid_value_error.rb', line 10 def initialize(field) super(I18n.t('modulorails.errors.invalid_value', field: field)) @field = field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
7 8 9 |
# File 'lib/modulorails/errors/invalid_value_error.rb', line 7 def field @field end |
#r field(field) ⇒ Object
The name of the field that had a wrong value.
7 |
# File 'lib/modulorails/errors/invalid_value_error.rb', line 7 attr_reader :field |