Class: Lutaml::Model::MaxLengthError

Inherits:
RestrictionError show all
Defined in:
lib/lutaml/model/error/max_length_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr_name, value, max_length) ⇒ MaxLengthError

Returns a new instance of MaxLengthError.



6
7
8
9
10
11
12
# File 'lib/lutaml/model/error/max_length_error.rb', line 6

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

  super()
end

Instance Method Details

#to_sObject



14
15
16
17
# File 'lib/lutaml/model/error/max_length_error.rb', line 14

def to_s
  "#{@attr_name} length (#{@value.to_s.length}) is greater than " \
    "the maximum allowed length #{@max_length}"
end