Class: BacktrackXPath

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

Overview

for use with the Rexle gem

Instance Method Summary collapse

Constructor Details

#initialize(node, use_attributes: true, ignore_id: false) ⇒ BacktrackXPath

Returns a new instance of BacktrackXPath.



9
10
11
12
13
14
# File 'lib/backtrack-xpath.rb', line 9

def initialize(node, use_attributes: true, ignore_id: false)

  @use_attributes, @ignore_id = use_attributes, ignore_id
  @xpath = doc_scan(node).flatten.compact.join('/')

end

Instance Method Details

#to_sObject Also known as: to_xpath



16
17
18
# File 'lib/backtrack-xpath.rb', line 16

def to_s
  @xpath
end