Sha256: 78f1fbb2faf51f4125846dd9a46794732763b4bce13acccb909fe077b52a3483

Contents?: true

Size: 218 Bytes

Versions: 12

Compression:

Stored size: 218 Bytes

Contents

module MongoModel
  module Types
    class Float < Object
      def cast(value)
        value.to_f if value.respond_to?(:to_f)
      end
      
      def boolean(value)
        !value.zero?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mongomodel-0.2.5 lib/mongomodel/support/types/float.rb
mongomodel-0.2.4 lib/mongomodel/support/types/float.rb
mongomodel-0.2.3 lib/mongomodel/support/types/float.rb
mongomodel-0.2.2 lib/mongomodel/support/types/float.rb
mongomodel-0.2.1 lib/mongomodel/support/types/float.rb
mongomodel-0.2.0 lib/mongomodel/support/types/float.rb
mongomodel-0.1.6 lib/mongomodel/support/types/float.rb
mongomodel-0.1.5 lib/mongomodel/support/types/float.rb
mongomodel-0.1.4 lib/mongomodel/support/types/float.rb
mongomodel-0.1.3 lib/mongomodel/support/types/float.rb
mongomodel-0.1.1 lib/mongomodel/support/types/float.rb
mongomodel-0.1 lib/mongomodel/support/types/float.rb