Exception: Structify::VersionRangeError
- Defined in:
- lib/structify.rb
Overview
Error raised when trying to access a field outside its specified version range
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.
-
#valid_versions ⇒ Object
readonly
Returns the value of attribute valid_versions.
Instance Method Summary collapse
-
#initialize(field_name, record_version, valid_versions) ⇒ VersionRangeError
constructor
A new instance of VersionRangeError.
Constructor Details
#initialize(field_name, record_version, valid_versions) ⇒ VersionRangeError
Returns a new instance of VersionRangeError.
88 89 90 91 92 93 94 95 96 97 |
# File 'lib/structify.rb', line 88 def initialize(field_name, record_version, valid_versions) @field_name = field_name @record_version = record_version @valid_versions = valid_versions = "Field '#{field_name}' is not available in version #{record_version}. " \ "This field is only available in versions: #{format_versions(valid_versions)}." super() end |
Instance Attribute Details
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
86 87 88 |
# File 'lib/structify.rb', line 86 def field_name @field_name end |
#record_version ⇒ Object (readonly)
Returns the value of attribute record_version.
86 87 88 |
# File 'lib/structify.rb', line 86 def record_version @record_version end |
#valid_versions ⇒ Object (readonly)
Returns the value of attribute valid_versions.
86 87 88 |
# File 'lib/structify.rb', line 86 def valid_versions @valid_versions end |