Exception: Modulorails::InvalidFormatError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/modulorails/errors/invalid_format_error.rb

Overview

An exception representing an invalid format for a given field.

Author:

  • Matthieu CIAPPARA <ciappa_m@modulotech.fr>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field) ⇒ InvalidFormatError

Returns a new instance of InvalidFormatError.

Parameters:

  • field (String)


9
10
11
12
13
# File 'lib/modulorails/errors/invalid_format_error.rb', line 9

def initialize(field)
  super(I18n.t('modulorails.errors.invalid_format', field: field))

  @field = field
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



6
7
8
# File 'lib/modulorails/errors/invalid_format_error.rb', line 6

def field
  @field
end

#r field(field) ⇒ Object

The name of the field that had a wrong format.



6
# File 'lib/modulorails/errors/invalid_format_error.rb', line 6

attr_reader :field