module XPath::XPathObject
Public Instance Methods
Source
# File lib/xml/xpath.rb, line 561 def <(other) if other.is_a? XPathNodeSet then other > self else to_f < other.to_f end end
Source
# File lib/xml/xpath.rb, line 577 def <=(other) if other.is_a? XPathNodeSet then other >= self else to_f <= other.to_f end end
Source
# File lib/xml/xpath.rb, line 552 def ==(other) if other.is_a? XPathNodeSet or other.is_a? XPathBoolean or other.is_a? XPathNumber then other == self else to_str == other.to_str end end
called from compiled XPath
expression
Source
# File lib/xml/xpath.rb, line 569 def >(other) if other.is_a? XPathNodeSet then other < self else to_f > other.to_f end end
Source
# File lib/xml/xpath.rb, line 585 def >=(other) if other.is_a? XPathNodeSet then other <= self else to_f >= other.to_f end end
Source
# File lib/xml/xpath.rb, line 605 def funcall(name) # for XPointer raise XPath::NameError, "undefined function `#{name}' for #{_type}" end
Source
# File lib/xml/xpath.rb, line 597 def predicate(&block) type_error 'NodeSet' end
Source
# File lib/xml/xpath.rb, line 543 def to_boolean(context) # => to XPath Boolean. shouldn't override. context.make_boolean true? end
Source
# File lib/xml/xpath.rb, line 539 def to_number(context) # => to XPath Number. shouldn't override. context.make_number to_f end
Source
# File lib/xml/xpath.rb, line 530 def to_predicate # => to Ruby Float, true or false. shouldn't override. true? end
Source
# File lib/xml/xpath.rb, line 514 def to_str # => to Ruby String type_error 'String' end
Source
# File lib/xml/xpath.rb, line 535 def to_string(context) # => to XPath String. shouldn't override. context.make_string to_str end
Source
# File lib/xml/xpath.rb, line 522 def true? # => to Ruby Boolean type_error 'Boolean' end
Private Instance Methods
Source
# File lib/xml/xpath.rb, line 503 def _type type.name.sub(/\A.*::(?:XPath)?(?=[^:]+\z)/, '') end
Source
# File lib/xml/xpath.rb, line 508 def type_error(into) raise XPath::TypeError, "failed to convert #{_type} into #{into}" end