Exception: Saxon::ItemType::LexicalStringConversion::Errors::RubyValueOutOfBounds

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/saxon/item_type/lexical_string_conversion.rb

Overview

Raised during conversion from Ruby value to XDM type lexical string when the ruby value fits the Type’s string representation, but is out of the permitted bounds for the type, for instance an integer bigger than 32767 for the type xs:short

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, item_type) ⇒ RubyValueOutOfBounds

Returns a new instance of RubyValueOutOfBounds.



521
522
523
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 521

def initialize(value, item_type)
  @value, @item_type = value, item_type
end

Instance Attribute Details

#item_typeObject (readonly)

Returns the value of attribute item_type.



519
520
521
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 519

def item_type
  @item_type
end

#valueObject (readonly)

Returns the value of attribute value.



519
520
521
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 519

def value
  @value
end

Instance Method Details

#to_sObject

error message includes Ruby value and the XDM type whose bounds it is outside of



526
527
528
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 526

def to_s
  "Ruby value #{value.inspect} is outside the allowed bounds of an XDM #{item_type.type_name.to_s}"
end