Exception: Lutaml::Model::InvalidChoiceRangeError

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

Instance Method Summary collapse

Constructor Details

#initialize(min, max) ⇒ InvalidChoiceRangeError



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

def initialize(min, max)
  @min = min
  @max = max

  super()
end

Instance Method Details

#to_sObject



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

def to_s
  bound_name, value = @min.negative? ? ["lower", @min] : ["upper", @max]

  "Choice #{bound_name} bound `#{value}` must be positive"
end