module Mongoid::Extensions::Range

Adds type-casting behavior to Range class.

Public Class Methods

included(base) click to toggle source
# File lib/mongoid/extensions/range.rb, line 8
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

__find_args__() click to toggle source

Get the range as arguments for a find.

@example Get the range as find args.

range.__find_args__

@return [ Array ] The range as an array. @deprecated

# File lib/mongoid/extensions/range.rb, line 19
def __find_args__
  to_a
end
mongoize() click to toggle source

Turn the object from the ruby type we deal with to a Mongo friendly type.

@example Mongoize the object.

range.mongoize

@return [ Hash | nil ] The object mongoized or nil.

# File lib/mongoid/extensions/range.rb, line 31
def mongoize
  ::Range.mongoize(self)
end
resizable?() click to toggle source

Is this a resizable object.

@example Is this resizable?

range.resizable?

@return [ true ] True.

# File lib/mongoid/extensions/range.rb, line 41
def resizable?
  true
end