Class: Arel::Collectors::Composite

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ Composite

Returns a new instance of Composite.



8
9
10
11
# File 'lib/arel/collectors/composite.rb', line 8

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

Instance Attribute Details

#preparableObject

Returns the value of attribute preparable.



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

def preparable
  @preparable
end

Instance Method Details

#<<(str) ⇒ Object



13
14
15
16
17
# File 'lib/arel/collectors/composite.rb', line 13

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

#add_bind(bind, &block) ⇒ Object



19
20
21
22
23
# File 'lib/arel/collectors/composite.rb', line 19

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

#add_binds(binds, proc_for_binds = nil, &block) ⇒ Object



25
26
27
28
29
# File 'lib/arel/collectors/composite.rb', line 25

def add_binds(binds, proc_for_binds = nil, &block)
  left.add_binds(binds, proc_for_binds, &block)
  right.add_binds(binds, proc_for_binds, &block)
  self
end

#valueObject



31
32
33
# File 'lib/arel/collectors/composite.rb', line 31

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