Exception: DynamicSchema::InOptionError

Inherits:
Error
  • Object
show all
Defined in:
lib/dynamic_schema/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



39
40
41
# File 'lib/dynamic_schema/errors.rb', line 39

def key
  @key
end

#keypathObject (readonly)

Returns the value of attribute keypath.



38
39
40
# File 'lib/dynamic_schema/errors.rb', line 38

def keypath
  @keypath
end