Class: XPath::Expression::Variable

Inherits:
XPath::Expression show all
Defined in:
lib/xpath/expression.rb

Constant Summary

Constants included from XPath

VERSION

Instance Method Summary collapse

Methods inherited from XPath::Expression

#and, #apply, #current, #equals, #inverse, #is, #next_sibling, #normalize, #one_of, #or, #string_literal, #to_s, #to_xpaths, #union, #where, #wrap_xpath

Methods included from XPath

#anywhere, #attr, #child, #contains, #css, #current, #descendant, generate, #name, #string, #tag, #text, #var, #varstring

Constructor Details

#initialize(name) ⇒ Variable

Returns a new instance of Variable.



194
195
196
# File 'lib/xpath/expression.rb', line 194

def initialize(name)
  @name = name
end

Instance Method Details

#to_xpath(predicate = nil) ⇒ Object



198
199
200
# File 'lib/xpath/expression.rb', line 198

def to_xpath(predicate=nil)
  "%{#{@name}}"
end