Exception: Lutaml::Model::InvalidValueError

Inherits:
Error
  • Object
show all
Defined in:
lib/lutaml/model/error/invalid_value_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr_name, value, allowed_values) ⇒ InvalidValueError

Returns a new instance of InvalidValueError.



4
5
6
7
8
9
10
# File 'lib/lutaml/model/error/invalid_value_error.rb', line 4

def initialize(attr_name, value, allowed_values)
  @attr_name = attr_name
  @value = value
  @allowed_values = allowed_values

  super()
end

Instance Method Details

#to_sObject



12
13
14
15
# File 'lib/lutaml/model/error/invalid_value_error.rb', line 12

def to_s
  "#{@attr_name} is `#{@value}`, must be one of the " \
    "following [#{@allowed_values.join(', ')}]"
end