Module: XPath::DSL::TopLevel

Included in:
XPath, XPath, ExpressionLevel
Defined in:
lib/xpath/dsl.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) anywhere(expression)



24
25
26
# File 'lib/xpath/dsl.rb', line 24

def anywhere(expression)
  Expression.new(:anywhere, expression)
end

- (Object) attr(expression)



28
29
30
# File 'lib/xpath/dsl.rb', line 28

def attr(expression)
  Expression.new(:attribute, current, expression)
end

- (Object) axis(name, tag_name = :*)



20
21
22
# File 'lib/xpath/dsl.rb', line 20

def axis(name, tag_name=:*)
  Expression.new(:axis, current, name, tag_name)
end

- (Object) child(*expressions)



16
17
18
# File 'lib/xpath/dsl.rb', line 16

def child(*expressions)
  Expression.new(:child, current, expressions)
end

- (Object) contains(expression)



32
33
34
# File 'lib/xpath/dsl.rb', line 32

def contains(expression)
  Expression.new(:contains, current, expression)
end

- (Object) css(selector)



48
49
50
# File 'lib/xpath/dsl.rb', line 48

def css(selector)
  Expression.new(:css, current, Literal.new(selector))
end

- (Object) current



4
5
6
# File 'lib/xpath/dsl.rb', line 4

def current
  Expression.new(:this_node)
end

- (Object) descendant(*expressions)



12
13
14
# File 'lib/xpath/dsl.rb', line 12

def descendant(*expressions)
  Expression.new(:descendant, current, expressions)
end

- (Object) name



8
9
10
# File 'lib/xpath/dsl.rb', line 8

def name
  Expression.new(:node_name, current)
end

- (Object) starts_with(expression)



36
37
38
# File 'lib/xpath/dsl.rb', line 36

def starts_with(expression)
  Expression.new(:starts_with, current, expression)
end

- (Object) string



44
45
46
# File 'lib/xpath/dsl.rb', line 44

def string
  Expression.new(:string_function, current)
end

- (Object) text



40
41
42
# File 'lib/xpath/dsl.rb', line 40

def text
  Expression.new(:text, current)
end