Class: Saxon::XPath::VariableDeclaration
- Inherits:
-
Object
- Object
- Saxon::XPath::VariableDeclaration
- Defined in:
- lib/saxon/xpath/variable_declaration.rb
Overview
Represents an XPath variable declaration in the static context of a compiled XPath, providing an idiomatic Ruby way to deal with these.
Instance Attribute Summary collapse
- #qname ⇒ Saxon::QName readonly
- #sequence_type ⇒ Saxon::SequenceType readonly
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
VariableDeclarations compare equal if their qname and sequence_type are equal.
-
#compiler_args ⇒ Object
private
return the arguments XPathCompiler.declareVariable expects.
-
#initialize(qname, sequence_type) ⇒ VariableDeclaration
constructor
A new instance of VariableDeclaration.
Constructor Details
#initialize(qname, sequence_type) ⇒ VariableDeclaration
Returns a new instance of VariableDeclaration.
16 17 18 19 |
# File 'lib/saxon/xpath/variable_declaration.rb', line 16 def initialize(qname, sequence_type) @qname = qname @sequence_type = sequence_type || Saxon.SequenceType('item()*') end |
Instance Attribute Details
#qname ⇒ Saxon::QName (readonly)
9 10 11 |
# File 'lib/saxon/xpath/variable_declaration.rb', line 9 def qname @qname end |
#sequence_type ⇒ Saxon::SequenceType (readonly)
11 12 13 |
# File 'lib/saxon/xpath/variable_declaration.rb', line 11 def sequence_type @sequence_type end |
Instance Method Details
#==(other) ⇒ Boolean
VariableDeclarations compare equal if their qname and sequence_type are equal
24 25 26 |
# File 'lib/saxon/xpath/variable_declaration.rb', line 24 def ==(other) VariableDeclaration === other && qname == other.qname && sequence_type == other.sequence_type end |
#compiler_args ⇒ Object
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.
return the arguments XPathCompiler.declareVariable expects
30 31 32 |
# File 'lib/saxon/xpath/variable_declaration.rb', line 30 def compiler_args [qname.to_java, sequence_type.item_type.to_java, sequence_type.occurrence_indicator.to_java] end |