Class: REXML::XPathNode

Inherits:
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.



921
922
923
924
925
926
927
928
# File 'lib/rexml/xpath_parser.rb', line 921

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.



920
921
922
# File 'lib/rexml/xpath_parser.rb', line 920

def context
  @context
end

#raw_nodeObject (readonly)

Returns the value of attribute raw_node.



920
921
922
# File 'lib/rexml/xpath_parser.rb', line 920

def raw_node
  @raw_node
end

Instance Method Details

#positionObject



930
931
932
# File 'lib/rexml/xpath_parser.rb', line 930

def position
  @context[:position]
end