Module: XPath
- Extended by:
- XPath
- Included in:
- XPath, Expression, HTML
- Defined in:
- lib/xpath.rb,
lib/xpath/html.rb,
lib/xpath/union.rb,
lib/xpath/version.rb,
lib/xpath/expression.rb
Defined Under Namespace
Modules: HTML
Classes: Expression, Union
Constant Summary
collapse
- VERSION =
'0.1.0'
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.generate {|Expression::Self.new| ... } ⇒ Object
8
9
10
|
# File 'lib/xpath.rb', line 8
def self.generate
yield(Expression::Self.new)
end
|
Instance Method Details
#anywhere(expression) ⇒ Object
28
29
30
|
# File 'lib/xpath.rb', line 28
def anywhere(expression)
Expression::Anywhere.new(expression)
end
|
#attr(expression) ⇒ Object
32
33
34
|
# File 'lib/xpath.rb', line 32
def attr(expression)
Expression::Attribute.new(current, expression)
end
|
#child(*expressions) ⇒ Object
24
25
26
|
# File 'lib/xpath.rb', line 24
def child(*expressions)
Expression::Child.new(current, expressions)
end
|
#contains(expression) ⇒ Object
36
37
38
|
# File 'lib/xpath.rb', line 36
def contains(expression)
Expression::Contains.new(current, expression)
end
|
#current ⇒ Object
12
13
14
|
# File 'lib/xpath.rb', line 12
def current
Expression::Self.new
end
|
#descendant(*expressions) ⇒ Object
20
21
22
|
# File 'lib/xpath.rb', line 20
def descendant(*expressions)
Expression::Descendant.new(current, expressions)
end
|
#varstring(name) ⇒ Object
48
49
50
|
# File 'lib/xpath.rb', line 48
def varstring(name)
var(name).string_literal
end
|