Class: Xembly::Xpath

Inherits:
Object
  • Object
show all
Defined in:
lib/xembly/xpath.rb

Overview

XPATH directive

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Xpath

Ctor.

path

Path



30
31
32
# File 'lib/xembly/xpath.rb', line 30

def initialize(path)
  @path = path
end

Instance Method Details

#exec(_, cursor) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/xembly/xpath.rb', line 34

def exec(_, cursor)
  after = []
  cursor.each do |node|
    node.xpath(@path).each { |n| after.push(n) }
  end
  after
end