Sha256: a788878efb7d667beb0112b9f9b6d4345bbb9c1a822c60d09cf966f56b446a71

Contents?: true

Size: 370 Bytes

Versions: 7

Compression:

Stored size: 370 Bytes

Contents

module Danica
  module BaseOperations
    def +(other)
      return other + self if other.is_a?(Sum)
      Sum.new(self, other)
    end

    def *(other)
      return other * self if other.is_a?(Product)
      Product.new(self, other)
    end

    def /(other)
      Division.new(self, other)
    end

    def -(other)
      self + Negative.new(other)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
danica-2.2.1 lib/danica/base_operations.rb
danica-2.2.0 lib/danica/base_operations.rb
danica-2.1.1 lib/danica/base_operations.rb
danica-2.1.0 lib/danica/base_operations.rb
danica-2.0.6 lib/danica/base_operations.rb
danica-2.0.5 lib/danica/base_operations.rb
danica-2.0.4 lib/danica/base_operations.rb