Sha256: 220ecd2069eae780b5750301e6acb7645d461d139a9559345be860d895d5e875

Contents?: true

Size: 274 Bytes

Versions: 26

Compression:

Stored size: 274 Bytes

Contents

module MongoModel
  module Types
    class Float < Object
      def cast(value)
        if value.nil?
          nil
        else
          Kernel::Float(value) rescue nil
        end
      end
      
      def boolean(value)
        !value.zero?
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mongomodel-0.4.3 lib/mongomodel/support/types/float.rb
mongomodel-0.4.2 lib/mongomodel/support/types/float.rb
mongomodel-0.4.1 lib/mongomodel/support/types/float.rb
mongomodel-0.4.0 lib/mongomodel/support/types/float.rb
mongomodel-0.3.6 lib/mongomodel/support/types/float.rb
mongomodel-0.3.5 lib/mongomodel/support/types/float.rb
mongomodel-0.3.4 lib/mongomodel/support/types/float.rb
mongomodel-0.3.3 lib/mongomodel/support/types/float.rb
mongomodel-0.3.2 lib/mongomodel/support/types/float.rb
mongomodel-0.3.1 lib/mongomodel/support/types/float.rb
mongomodel-0.3.0 lib/mongomodel/support/types/float.rb
mongomodel-0.2.20 lib/mongomodel/support/types/float.rb
mongomodel-0.2.19 lib/mongomodel/support/types/float.rb
mongomodel-0.2.18 lib/mongomodel/support/types/float.rb
mongomodel-0.2.17 lib/mongomodel/support/types/float.rb
mongomodel-0.2.16 lib/mongomodel/support/types/float.rb
mongomodel-0.2.15 lib/mongomodel/support/types/float.rb
mongomodel-0.2.14 lib/mongomodel/support/types/float.rb
mongomodel-0.2.13 lib/mongomodel/support/types/float.rb
mongomodel-0.2.12 lib/mongomodel/support/types/float.rb