Class: XPath::Expression::OneOf
- Inherits:
-
XPath::Expression
- Object
- XPath::Expression
- XPath::Expression::OneOf
- Defined in:
- lib/xpath/expression.rb
Constant Summary
Constants included from XPath
Instance Method Summary collapse
-
#initialize(left, right) ⇒ OneOf
constructor
A new instance of OneOf.
- #to_xpath(predicate = nil) ⇒ Object
Methods inherited from XPath::Expression
#and, #apply, #current, #equals, #inverse, #is, #next_sibling, #normalize, #one_of, #or, #string_literal, #to_s, #to_xpaths, #union, #where, #wrap_xpath
Methods included from XPath
#anywhere, #attr, #child, #contains, #css, #current, #descendant, generate, #name, #string, #tag, #text, #var, #varstring
Constructor Details
#initialize(left, right) ⇒ OneOf
Returns a new instance of OneOf.
161 162 163 164 |
# File 'lib/xpath/expression.rb', line 161 def initialize(left, right) @left = wrap_xpath(left) @right = right.map { |r| wrap_xpath(r) } end |
Instance Method Details
#to_xpath(predicate = nil) ⇒ Object
166 167 168 |
# File 'lib/xpath/expression.rb', line 166 def to_xpath(predicate=nil) @right.map { |r| "#{@left.to_xpath(predicate)} = #{r.to_xpath(predicate)}" }.join(' or ') end |