Class: BacktrackXPath
- Inherits:
-
Object
- Object
- BacktrackXPath
- Defined in:
- lib/backtrack-xpath.rb
Overview
for use with the Rexle gem
Instance Method Summary collapse
-
#initialize(node, use_attributes: true, ignore_id: false) ⇒ BacktrackXPath
constructor
A new instance of BacktrackXPath.
- #to_s ⇒ Object (also: #to_xpath)
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_s ⇒ Object Also known as: to_xpath
16 17 18 |
# File 'lib/backtrack-xpath.rb', line 16 def to_s @xpath end |