Module: Mongoid::Extensions::Float

Defined in:
lib/mongoid/extensions/float.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Time) __mongoize_time__

Convert the float into a time.

Examples:

Convert the float into a time.

1335532685.117847.__mongoize_time__

Since:

  • 3.0.0



14
15
16
# File 'lib/mongoid/extensions/float.rb', line 14

def __mongoize_time__
  ::Time.at(self)
end

- (true) numeric?

Is the float a number?

Examples:

Is the object a number?.

object.numeric?

Since:

  • 3.0.0



26
27
28
# File 'lib/mongoid/extensions/float.rb', line 26

def numeric?
  true
end