Class: XPath::Expression

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/xpath/expression.rb

Constant Summary

Constants included from DSL

DSL::AXES, DSL::METHODS, DSL::OPERATORS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL

#anywhere, #attr, #axis, #binary_operator, #child, #css, #descendant, #function, #is, #last, #method, #next_sibling, #one_of, #position, #previous_sibling, #text, #union, #where

Constructor Details

#initialize(expression, *arguments) ⇒ Expression

Returns a new instance of Expression.



6
7
8
9
# File 'lib/xpath/expression.rb', line 6

def initialize(expression, *arguments)
  @expression = expression
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



3
4
5
# File 'lib/xpath/expression.rb', line 3

def arguments
  @arguments
end

#expressionObject

Returns the value of attribute expression.



3
4
5
# File 'lib/xpath/expression.rb', line 3

def expression
  @expression
end

Instance Method Details

#currentObject



11
12
13
# File 'lib/xpath/expression.rb', line 11

def current
  self
end

#to_xpath(type = nil) ⇒ Object Also known as: to_s



15
16
17
# File 'lib/xpath/expression.rb', line 15

def to_xpath(type=nil)
  Renderer.render(self, type)
end