Class: XPath::Union

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/xpath/union.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*expressions) ⇒ Union

Returns a new instance of Union.



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

def initialize(*expressions)
  @expressions = expressions
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



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

def method_missing(*args)
  XPath::Union.new(*arguments.map { |e| e.send(*args) })
end

Instance Attribute Details

#expressionsObject (readonly) Also known as: arguments

Returns the value of attribute expressions.



5
6
7
# File 'lib/xpath/union.rb', line 5

def expressions
  @expressions
end

Instance Method Details

#each(&block) ⇒ Object



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

def each(&block)
  arguments.each(&block)
end

#expressionObject



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

def expression
  :union
end

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



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

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