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

Returns a new instance of 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
16
17
# File 'lib/lutaml/model/error/invalid_choice_range_error.rb', line 11

def to_s
  if @min.negative?
    "Choice lower bound `#{@min}` must be positive"
  else
    "Choice upper bound `#{@max}` must be positive"
  end
end