Module: Mongoid::Extensions::Range
- Defined in:
- lib/mongoid/extensions/range.rb
Overview
Adds type-casting behavior to Range class.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #__find_args__ ⇒ Array deprecated Deprecated.
-
#mongoize ⇒ Hash | nil
Turn the object from the ruby type we deal with to a Mongo friendly type.
-
#resizable? ⇒ true
Is this a resizable object.
Class Method Details
.included(base) ⇒ Object
8 9 10 |
# File 'lib/mongoid/extensions/range.rb', line 8 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#__find_args__ ⇒ Array
Deprecated.
Get the range as arguments for a find.
19 20 21 |
# File 'lib/mongoid/extensions/range.rb', line 19 def __find_args__ to_a end |
#mongoize ⇒ Hash | nil
Turn the object from the ruby type we deal with to a Mongo friendly type.
31 32 33 |
# File 'lib/mongoid/extensions/range.rb', line 31 def mongoize ::Range.mongoize(self) end |
#resizable? ⇒ true
Is this a resizable object.
41 42 43 |
# File 'lib/mongoid/extensions/range.rb', line 41 def resizable? true end |