Class: XML::XXPath::NameStep

Inherits:
Step
  • Object
show all
Defined in:
lib/xml/xxpath/steps.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Step

#creator, inherited, #reader

Constructor Details

#initialize(axis, name) ⇒ NameStep

Returns a new instance of NameStep.



331
332
333
334
# File 'lib/xml/xxpath/steps.rb', line 331

def initialize(axis,name)
  super(axis)
  @name = name
end

Class Method Details

.compile(axis, string) ⇒ Object



327
328
329
# File 'lib/xml/xxpath/steps.rb', line 327

def self.compile axis, string
  self.new axis,string
end

Instance Method Details

#create_on(node, create_new) ⇒ Object



340
341
342
# File 'lib/xml/xxpath/steps.rb', line 340

def create_on(node,create_new)
  node.elements.add @name
end

#matches?(node) ⇒ Boolean

Returns:

  • (Boolean)


336
337
338
# File 'lib/xml/xxpath/steps.rb', line 336

def matches? node
  node.is_a?(REXML::Element) and node.name==@name
end