Sha256: 2d8f81dde1c82d5a5a035caa97a720b6bcdfe97cb5ebf184f9a17735c1d5f7c9

Contents?: true

Size: 596 Bytes

Versions: 6

Compression:

Stored size: 596 Bytes

Contents

module DataMapper
  class Property
    class Float < Numeric
      primitive ::Float

      DEFAULT_PRECISION = 10
      DEFAULT_SCALE     = nil

      precision(DEFAULT_PRECISION)
      scale(DEFAULT_SCALE)

      protected

      # Typecast a value to a Float
      #
      # @param [#to_str, #to_f] value
      #   value to typecast
      #
      # @return [Float]
      #   Float constructed from value
      #
      # @api private
      def typecast_to_primitive(value)
        typecast_to_numeric(value, :to_f)
      end
    end # class Float
  end # class Property
end # module DataMapper

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ardm-core-1.3.0 lib/dm-core/property/float.rb
ardm-core-1.2.1 lib/dm-core/property/float.rb
dm-core-1.2.1 lib/dm-core/property/float.rb
dm-core-1.2.0 lib/dm-core/property/float.rb
dm-core-1.2.0.rc2 lib/dm-core/property/float.rb
dm-core-1.2.0.rc1 lib/dm-core/property/float.rb