Class: Arel::Collectors::Composite

Inherits:
Object
  • Object
show all
Defined in:
lib/arel/collectors/composite.rb

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ Composite

Returns a new instance of Composite.



6
7
8
9
# File 'lib/arel/collectors/composite.rb', line 6

def initialize(left, right)
  @left = left
  @right = right
end

Instance Method Details

#<<(str) ⇒ Object



11
12
13
14
15
# File 'lib/arel/collectors/composite.rb', line 11

def <<(str)
  left << str
  right << str
  self
end

#add_bind(bind, &block) ⇒ Object



17
18
19
20
21
# File 'lib/arel/collectors/composite.rb', line 17

def add_bind(bind, &block)
  left.add_bind bind, &block
  right.add_bind bind, &block
  self
end

#valueObject



23
24
25
# File 'lib/arel/collectors/composite.rb', line 23

def value
  [left.value, right.value]
end