Sha256: 57de24ee2d0ba7eacfa591dc6ece88e60fa483b32176c3e6040c9e06b2b072e4

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

# encoding: utf-8

module Axiom
  class Function
    class Numeric

      # A mixin for numeric Binary functions
      module Binary
        include Function::Binary

        # Return the type returned from #call
        #
        # @return [Class<Attribute::Numeric>]
        #
        # @api public
        def type
          util       = Attribute
          left_type  = util.infer_type(left)
          right_type = util.infer_type(right)
          left_type.equal?(right_type) ? left_type : Attribute::Numeric
        end

      end # module Binary
    end # class Numeric
  end # class Function
end # module Axiom

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 lib/axiom/function/numeric/binary.rb