Class: Saxon::XdmAtomicValue

Inherits:
Object
  • Object
show all
Defined in:
lib/saxon/xdm_atomic_value.rb

Overview

An XPath Data Model Node object, representing an XML document, or an element or one of the other node chunks in the XDM.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(s9_xdm_atomic_value) ⇒ XdmAtomicValue

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of XdmAtomicValue.



18
19
20
# File 'lib/saxon/xdm_atomic_value.rb', line 18

def initialize(s9_xdm_atomic_value)
  @s9_xdm_atomic_value = s9_xdm_atomic_value
end

Class Method Details

.create(value) ⇒ Saxon::XdmAtomicValue

convert a single Ruby value into an XdmAtomicValue



10
11
12
# File 'lib/saxon/xdm_atomic_value.rb', line 10

def self.create(value)
  new(Saxon::S9API::XdmAtomicValue.new(value))
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

compares two Saxon::XdmAtomicValues using the underlying Saxon and XDM comparision rules



37
38
39
40
# File 'lib/saxon/xdm_atomic_value.rb', line 37

def ==(other)
  return false unless other.is_a?(XdmAtomicValue)
  s9_xdm_atomic_value.equals(other.to_java)
end

#hashObject



44
45
46
# File 'lib/saxon/xdm_atomic_value.rb', line 44

def hash
  @hash ||= s9_xdm_atomic_value.hashCode
end

#to_javaSaxon::S9API::XdmAtomicValue



30
31
32
# File 'lib/saxon/xdm_atomic_value.rb', line 30

def to_java
  s9_xdm_atomic_value
end

#type_nameSaxon::QName

Return a QName representing the type of the value



25
26
27
# File 'lib/saxon/xdm_atomic_value.rb', line 25

def type_name
  @type_name ||= Saxon::QName.new(s9_xdm_atomic_value.getTypeName)
end