math.rb 382 B

12345678910111213141516171819
  1. module Arel
  2. module Math
  3. def *(other)
  4. Arel::Nodes::Multiplication.new(self, other)
  5. end
  6. def +(other)
  7. Arel::Nodes::Grouping.new(Arel::Nodes::Addition.new(self, other))
  8. end
  9. def -(other)
  10. Arel::Nodes::Grouping.new(Arel::Nodes::Subtraction.new(self, other))
  11. end
  12. def /(other)
  13. Arel::Nodes::Division.new(self, other)
  14. end
  15. end
  16. end