Exception: DynamicSchema::InOptionError
- Defined in:
- lib/dynamic_schema/errors.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#keypath ⇒ Object
readonly
Returns the value of attribute keypath.
Instance Method Summary collapse
-
#initialize(path: nil, key:, option:, value:) ⇒ InOptionError
constructor
A new instance of InOptionError.
Constructor Details
#initialize(path: nil, key:, option:, value:) ⇒ InOptionError
41 42 43 44 45 46 |
# File 'lib/dynamic_schema/errors.rb', line 41 def initialize( path: nil, key:, option:, value: ) path = path ? path.chomp( '/' ) : nil @key = key @keypath = path ? ( path + '/' + @key.to_s ) : key.to_s super( "The attribute '#{@keypath}' must be in '#{option.to_s}' but '#{value.to_s}' was given." ) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
39 40 41 |
# File 'lib/dynamic_schema/errors.rb', line 39 def key @key end |
#keypath ⇒ Object (readonly)
Returns the value of attribute keypath.
38 39 40 |
# File 'lib/dynamic_schema/errors.rb', line 38 def keypath @keypath end |