Class: ArelExtensions::Nodes::Union

Inherits:
Arel::Nodes::Union show all
Defined in:
lib/arel_extensions/nodes/union.rb

Instance Method Summary collapse

Methods included from SetFunctions

#union_all, #uniq

Constructor Details

#initialize(left, right) ⇒ Union

Returns a new instance of Union.



4
5
6
# File 'lib/arel_extensions/nodes/union.rb', line 4

def initialize left, right
  super(left, right)
end

Instance Method Details

#+(other) ⇒ Object



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

def +(other)
  ArelExtensions::Nodes::Union.new(self, other)
end

#as(other) ⇒ Object



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

def as other
  Arel::Nodes::TableAlias.new Arel.grouping(self), Arel::Nodes::SqlLiteral.new(other.to_s)
end

#union(other) ⇒ Object



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

def union(other)
  ArelExtensions::Nodes::UnionAll.new(self, other)
end