Exception: Structify::MissingFieldError
- Defined in:
- lib/structify.rb
Overview
Error raised when trying to access a field that doesn’t exist in the record’s version
Instance Attribute Summary collapse
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#record_version ⇒ Object
readonly
Returns the value of attribute record_version.
-
#schema_version ⇒ Object
readonly
Returns the value of attribute schema_version.
Instance Method Summary collapse
-
#initialize(field_name, record_version, schema_version) ⇒ MissingFieldError
constructor
A new instance of MissingFieldError.
Constructor Details
#initialize(field_name, record_version, schema_version) ⇒ MissingFieldError
Returns a new instance of MissingFieldError.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/structify.rb', line 56 def initialize(field_name, record_version, schema_version) @field_name = field_name @record_version = record_version @schema_version = schema_version = "Field '#{field_name}' does not exist in version #{record_version}. " \ "It was introduced in version #{schema_version}. " \ "To access this field, upgrade the record by setting new field values and saving." super() end |
Instance Attribute Details
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
54 55 56 |
# File 'lib/structify.rb', line 54 def field_name @field_name end |
#record_version ⇒ Object (readonly)
Returns the value of attribute record_version.
54 55 56 |
# File 'lib/structify.rb', line 54 def record_version @record_version end |
#schema_version ⇒ Object (readonly)
Returns the value of attribute schema_version.
54 55 56 |
# File 'lib/structify.rb', line 54 def schema_version @schema_version end |