Exception: Saxon::ItemType::LexicalStringConversion::Errors::BadRubyValue

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 does not conform to the Type’s string representation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, item_type) ⇒ BadRubyValue

Returns a new instance of BadRubyValue.



503
504
505
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 503

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.



501
502
503
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 501

def item_type
  @item_type
end

#valueObject (readonly)

Returns the value of attribute value.



501
502
503
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 501

def value
  @value
end

Instance Method Details

#to_sObject

error message includes Ruby value and the XDM type conversion was being attempted to



509
510
511
# File 'lib/saxon/item_type/lexical_string_conversion.rb', line 509

def to_s
  "Ruby value #{value.inspect} cannot be converted to an XDM #{item_type.type_name.to_s}"
end