Class: REXML::XPathNode

Inherits:
Object
  • Object
show all
Defined in:
lib/rexml/xpath_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, context = nil) ⇒ XPathNode

Returns a new instance of XPathNode.



961
962
963
964
965
966
967
968
# File 'lib/rexml/xpath_parser.rb', line 961

def initialize(node, context=nil)
  if node.is_a?(XPathNode)
    @raw_node = node.raw_node
  else
    @raw_node = node
  end
  @context = context || {}
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



960
961
962
# File 'lib/rexml/xpath_parser.rb', line 960

def context
  @context
end

#raw_nodeObject (readonly)

Returns the value of attribute raw_node.



960
961
962
# File 'lib/rexml/xpath_parser.rb', line 960

def raw_node
  @raw_node
end

Instance Method Details

#positionObject



970
971
972
# File 'lib/rexml/xpath_parser.rb', line 970

def position
  @context[:position]
end