class XPath::Expression

Public Instance Methods

&(expression)
Alias for: and
+(*expressions)
Alias for: union
==(expression)
Alias for: equals
[](expression)
Alias for: where
and(expression) click to toggle source
# File lib/xpath/expression.rb, line 261
def and(expression)
  Expression::And.new(current, expression)
end
Also aliased as: &
apply(variables={}) click to toggle source
# File lib/xpath/expression.rb, line 292
def apply(variables={})
  Expression::Applied.new(current, variables)
end
current() click to toggle source
# File lib/xpath/expression.rb, line 230
def current
  self
end
equals(expression) click to toggle source
# File lib/xpath/expression.rb, line 247
def equals(expression)
  Expression::Equality.new(current, expression)
end
Also aliased as: ==
inverse() click to toggle source
# File lib/xpath/expression.rb, line 271
def inverse
  Expression::Inverse.new(current)
end
Also aliased as: ~
is(expression) click to toggle source
# File lib/xpath/expression.rb, line 252
def is(expression)
  Expression::Is.new(current, expression)
end
n()
Alias for: normalize
next_sibling(*expressions) click to toggle source
# File lib/xpath/expression.rb, line 234
def next_sibling(*expressions)
  Expression::NextSibling.new(current, expressions)
end
normalize() click to toggle source
# File lib/xpath/expression.rb, line 296
def normalize
  Expression::NormalizedSpace.new(current)
end
Also aliased as: n
one_of(*expressions) click to toggle source
# File lib/xpath/expression.rb, line 243
def one_of(*expressions)
  Expression::OneOf.new(current, expressions)
end
or(expression) click to toggle source
# File lib/xpath/expression.rb, line 256
def or(expression)
  Expression::Or.new(current, expression)
end
Also aliased as: |
string_literal() click to toggle source
# File lib/xpath/expression.rb, line 276
def string_literal
  Expression::StringLiteral.new(self)
end
to_s() click to toggle source
# File lib/xpath/expression.rb, line 284
def to_s
  to_xpaths.join(' | ')
end
to_xpath(predicate=nil) click to toggle source
# File lib/xpath/expression.rb, line 280
def to_xpath(predicate=nil)
  raise NotImplementedError, "please implement in subclass"
end
to_xpaths() click to toggle source
# File lib/xpath/expression.rb, line 288
def to_xpaths
  [to_xpath(:exact), to_xpath(:fuzzy)].uniq
end
union(*expressions) click to toggle source
# File lib/xpath/expression.rb, line 266
def union(*expressions)
  Union.new(*[self, expressions].flatten)
end
Also aliased as: +
where(expression) click to toggle source
# File lib/xpath/expression.rb, line 238
def where(expression)
  Expression::Where.new(current, expression)
end
Also aliased as: []
wrap_xpath(expression) click to toggle source
# File lib/xpath/expression.rb, line 301
def wrap_xpath(expression)
  case expression
    when ::String then Expression::StringLiteral.new(expression)
    when ::Symbol then Expression::Literal.new(expression)
    else expression
  end
end
|(expression)
Alias for: or
~()
Alias for: inverse