Exception: DynamicSchema::RequiredOptionError
- 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:) ⇒ RequiredOptionError
constructor
A new instance of RequiredOptionError.
Constructor Details
#initialize(path: nil, key:) ⇒ RequiredOptionError
Returns a new instance of RequiredOptionError.
27 28 29 30 31 32 |
# File 'lib/dynamic_schema/errors.rb', line 27 def initialize( path: nil, key: ) path = path ? path.chomp( '/' ) : nil @key = key @keypath = path ? ( path + '/' + @key.to_s ) : key.to_s super( "The attribute '#{@keypath}' is required but no value was given." ) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
25 26 27 |
# File 'lib/dynamic_schema/errors.rb', line 25 def key @key end |
#keypath ⇒ Object (readonly)
Returns the value of attribute keypath.
24 25 26 |
# File 'lib/dynamic_schema/errors.rb', line 24 def keypath @keypath end |