Namespace

Files

XPath

Constants

VERSION

Public Class Methods

generate() click to toggle source
# File lib/xpath.rb, line 10
def self.generate
  yield(Expression::Self.new)
end

Public Instance Methods

anywhere(expression) click to toggle source
# File lib/xpath.rb, line 30
def anywhere(expression)
  Expression::Anywhere.new(expression)
end
attr(expression) click to toggle source
# File lib/xpath.rb, line 34
def attr(expression)
  Expression::Attribute.new(current, expression)
end
child(*expressions) click to toggle source
# File lib/xpath.rb, line 26
def child(*expressions)
  Expression::Child.new(current, expressions)
end
contains(expression) click to toggle source
# File lib/xpath.rb, line 38
def contains(expression)
  Expression::Contains.new(current, expression)
end
css(selector) click to toggle source
# File lib/xpath.rb, line 58
def css(selector)
  paths = Nokogiri::CSS.xpath_for(selector).map do |selector|
    Expression::CSS.new(current, Expression::Literal.new(selector))
  end
  Union.new(*paths)
end
current() click to toggle source
# File lib/xpath.rb, line 14
def current
  Expression::Self.new
end
descendant(*expressions) click to toggle source
# File lib/xpath.rb, line 22
def descendant(*expressions)
  Expression::Descendant.new(current, expressions)
end
name() click to toggle source
# File lib/xpath.rb, line 18
def name
  Expression::Name.new(current)
end
string() click to toggle source
# File lib/xpath.rb, line 50
def string
  Expression::StringFunction.new(current)
end
tag(name) click to toggle source
# File lib/xpath.rb, line 54
def tag(name)
  Expression::Tag.new(name)
end
text() click to toggle source
# File lib/xpath.rb, line 42
def text
  Expression::Text.new(current)
end
var(name) click to toggle source
# File lib/xpath.rb, line 46
def var(name)
  Expression::Variable.new(name)
end
varstring(name) click to toggle source
# File lib/xpath.rb, line 65
def varstring(name)
  var(name).string_literal
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.