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.4'
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.generate {|Expression::Self.new| ... } ⇒ Object
10
11
12
|
# File 'lib/xpath.rb', line 10
def self.generate
yield(Expression::Self.new)
end
|
Instance Method Details
#anywhere(expression) ⇒ Object
30
31
32
|
# File 'lib/xpath.rb', line 30
def anywhere(expression)
Expression::Anywhere.new(expression)
end
|
#attr(expression) ⇒ Object
34
35
36
|
# File 'lib/xpath.rb', line 34
def attr(expression)
Expression::Attribute.new(current, expression)
end
|
#child(*expressions) ⇒ Object
26
27
28
|
# File 'lib/xpath.rb', line 26
def child(*expressions)
Expression::Child.new(current, expressions)
end
|
#contains(expression) ⇒ Object
38
39
40
|
# File 'lib/xpath.rb', line 38
def contains(expression)
Expression::Contains.new(current, expression)
end
|
#current ⇒ Object
14
15
16
|
# File 'lib/xpath.rb', line 14
def current
Expression::Self.new
end
|
#descendant(*expressions) ⇒ Object
22
23
24
|
# File 'lib/xpath.rb', line 22
def descendant(*expressions)
Expression::Descendant.new(current, expressions)
end
|
#tag(name) ⇒ Object
54
55
56
|
# File 'lib/xpath.rb', line 54
def tag(name)
Expression::Tag.new(name)
end
|
#varstring(name) ⇒ Object
65
66
67
|
# File 'lib/xpath.rb', line 65
def varstring(name)
var(name).string_literal
end
|