Exception: AdaptiveConfiguration::RequiredOptionError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil, key:) ⇒ RequiredOptionError

Returns a new instance of RequiredOptionError.



29
30
31
32
33
34
# File 'lib/adaptive_configuration/errors.rb', line 29

def initialize( path: nil, key:  )
  path = path ? path.chomp( '/' ) : nil 
  @key = key
  @keypath = path ? ( path + '/' + @key.to_s ) : key.to_s    
  super( "The parameter '#{@keypath}' is required but no value was given." )
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



27
28
29
# File 'lib/adaptive_configuration/errors.rb', line 27

def key
  @key
end

#keypathObject (readonly)

Returns the value of attribute keypath.



26
27
28
# File 'lib/adaptive_configuration/errors.rb', line 26

def keypath
  @keypath
end