aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/math.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/math.rb')
-rw-r--r--lib/arel/math.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/arel/math.rb b/lib/arel/math.rb
index f3dbc7bc49..04cae84598 100644
--- a/lib/arel/math.rb
+++ b/lib/arel/math.rb
@@ -15,5 +15,29 @@ module Arel
def /(other)
Arel::Nodes::Division.new(self, other)
end
+
+ def &(other)
+ Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseAnd.new(self, other))
+ end
+
+ def |(other)
+ Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseOr.new(self, other))
+ end
+
+ def ^(other)
+ Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseXor.new(self, other))
+ end
+
+ def <<(other)
+ Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseShiftLeft.new(self, other))
+ end
+
+ def >>(other)
+ Arel::Nodes::Grouping.new(Arel::Nodes::BitwiseShiftRight.new(self, other))
+ end
+
+ def ~@
+ Arel::Nodes::BitwiseNot.new(self)
+ end
end
end