Exception: Common::Exceptions::InvalidFieldValue
- Defined in:
- lib/common/exceptions/invalid_field_value.rb
Overview
InvalidFieldValue - field value is invalid
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(field, value) ⇒ InvalidFieldValue
constructor
A new instance of InvalidFieldValue.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(field, value) ⇒ InvalidFieldValue
Returns a new instance of InvalidFieldValue.
12 13 14 15 |
# File 'lib/common/exceptions/invalid_field_value.rb', line 12 def initialize(field, value) @field = field @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
10 11 12 |
# File 'lib/common/exceptions/invalid_field_value.rb', line 10 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/common/exceptions/invalid_field_value.rb', line 10 def value @value end |
Instance Method Details
#errors ⇒ Object
17 18 19 |
# File 'lib/common/exceptions/invalid_field_value.rb', line 17 def errors Array(SerializableError.new(i18n_interpolated(detail: { field: @field, value: @value }))) end |