Module: Arel::Math

Included in:
Attributes::Attribute, Nodes::InfixOperation, Nodes::UnaryOperation
Defined in:
lib/arel/math.rb

Instance Method Summary collapse

Instance Method Details

#&(other) ⇒ Object



19
20
21
# File 'lib/arel/math.rb', line 19

def &(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseAnd.new(self, other))
end

#*(other) ⇒ Object



3
4
5
# File 'lib/arel/math.rb', line 3

def *(other)
  Arel::Nodes::Multiplication.new(self, other)
end

#+(other) ⇒ Object



7
8
9
# File 'lib/arel/math.rb', line 7

def +(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::Addition.new(self, other))
end

#-(other) ⇒ Object



11
12
13
# File 'lib/arel/math.rb', line 11

def -(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::Subtraction.new(self, other))
end

#/(other) ⇒ Object



15
16
17
# File 'lib/arel/math.rb', line 15

def /(other)
  Arel::Nodes::Division.new(self, other)
end

#<<(other) ⇒ Object



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

def <<(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseShiftLeft.new(self, other))
end

#>>(other) ⇒ Object



35
36
37
# File 'lib/arel/math.rb', line 35

def >>(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseShiftRight.new(self, other))
end

#^(other) ⇒ Object



27
28
29
# File 'lib/arel/math.rb', line 27

def ^(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseXor.new(self, other))
end

#|(other) ⇒ Object



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

def |(other)
  Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseOr.new(self, other))
end

#~@Object



39
40
41
# File 'lib/arel/math.rb', line 39

def ~@
  Arel::Nodes::BitwiseNot.new(self)
end