Module: Mongoid::Extensions::Integer
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongoid/extensions/integer.rb |
Overview
Adds type-casting behavior to Integer
class.
Instance Attribute Summary
-
#numeric? ⇒ true
readonly
Is the integer a number?
- #unconvertable_to_bson? ⇒ true readonly deprecated Deprecated.
Instance Method Summary
-
#__mongoize_time__ ⇒ Time | ActiveSupport::TimeWithZone
Converts the integer into a time as the number of seconds since the epoch.
Instance Attribute Details
#numeric? ⇒ true
(readonly)
Is the integer a number?
# File 'lib/mongoid/extensions/integer.rb', line 26
def numeric? true end
#unconvertable_to_bson? ⇒ true
(readonly)
Deprecated.
Is the object not to be converted to bson on criteria creation?
# File 'lib/mongoid/extensions/integer.rb', line 37
def unconvertable_to_bson? true end
Instance Method Details
#__mongoize_time__ ⇒ Time | ActiveSupport::TimeWithZone
Converts the integer into a time as the number of seconds since the epoch.
# File 'lib/mongoid/extensions/integer.rb', line 16
def __mongoize_time__ ::Time.zone.at(self) end