Module: Mongoid::Extensions::Range

Defined in:
lib/mongoid/extensions/range.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#__find_args__Array

Get the range as arguments for a find.

Examples:

Get the range as find args.

range.__find_args__

Since:

  • 3.0.0



14
15
16
# File 'lib/mongoid/extensions/range.rb', line 14

def __find_args__
  to_a
end

#mongoizeHash

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

Examples:

Mongoize the object.

range.mongoize

Since:

  • 3.0.0



27
28
29
# File 'lib/mongoid/extensions/range.rb', line 27

def mongoize
  ::Range.mongoize(self)
end

#resizable?true

Is this a resizable object.

Examples:

Is this resizable?

range.resizable?

Since:

  • 3.0.0



39
40
41
# File 'lib/mongoid/extensions/range.rb', line 39

def resizable?
  true
end