Module: Mongoid::Extensions::Integer
- Defined in:
- lib/mongoid/extensions/integer.rb
Overview
Adds type-casting behavior to Integer class.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#__mongoize_time__ ⇒ Time | ActiveSupport::TimeWithZone
Converts the integer into a time as the number of seconds since the epoch.
-
#numeric? ⇒ true
Is the integer a number?.
- #unconvertable_to_bson? ⇒ true deprecated Deprecated.
Instance Method Details
#__mongoize_time__ ⇒ Time | ActiveSupport::TimeWithZone
Converts the integer into a time as the number of seconds since the epoch.
13 14 15 |
# File 'lib/mongoid/extensions/integer.rb', line 13 def __mongoize_time__ ::Time.zone.at(self) end |
#numeric? ⇒ true
Is the integer a number?
23 24 25 |
# File 'lib/mongoid/extensions/integer.rb', line 23 def numeric? true end |
#unconvertable_to_bson? ⇒ true
Deprecated.
Is the object not to be converted to bson on criteria creation?
34 35 36 |
# File 'lib/mongoid/extensions/integer.rb', line 34 def unconvertable_to_bson? true end |