module Mongoid::Extensions::Integer

Adds type-casting behavior to Integer class.

Public Instance Methods

__mongoize_time__() click to toggle source

Converts the integer into a time as the number of seconds since the epoch.

@example Convert the integer to a time.

1335532685.__mongoize_time__

@return [ Time | ActiveSupport::TimeWithZone ] The time.

# File lib/mongoid/extensions/integer.rb, line 16
def __mongoize_time__
  ::Time.zone.at(self)
end
numeric?() click to toggle source

Is the integer a number?

@example Is the object a number?.

object.numeric?

@return [ true ] Always true.

# File lib/mongoid/extensions/integer.rb, line 26
def numeric?
  true
end
unconvertable_to_bson?() click to toggle source

Is the object not to be converted to bson on criteria creation?

@example Is the object unconvertable?

object.unconvertable_to_bson?

@return [ true ] If the object is unconvertable. @deprecated

# File lib/mongoid/extensions/integer.rb, line 37
def unconvertable_to_bson?
  true
end