Class: Glia::Errors::ChangingFieldNotAllowedError
- Defined in:
- lib/glia/errors/client_errors.rb
Instance Attribute Summary
Attributes inherited from Error
#error_details, #message, #ref, #type
Instance Method Summary collapse
-
#initialize(resource:, field:, message: nil) ⇒ ChangingFieldNotAllowedError
constructor
A new instance of ChangingFieldNotAllowedError.
Methods inherited from Error
Constructor Details
#initialize(resource:, field:, message: nil) ⇒ ChangingFieldNotAllowedError
Returns a new instance of ChangingFieldNotAllowedError.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/glia/errors/client_errors.rb', line 252 def initialize(resource:, field:, message: nil) Naming.assert_snake_case(resource) Naming.assert_snake_case(field) = "Once value of `#{field}` is set for the #{Naming.humanize(resource, lowercase: true)}, it cannot be changed" super( type: CHANGING_FIELD_NOT_ALLOWED_ERROR, ref: create_ref(CHANGING_FIELD_NOT_ALLOWED_ERROR), message: || , error_details: { resource: resource, field: field } ) end |