Module: Mongoid::Extensions::Range

Defined in:
build/mongoid-8.1/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__

Returns:

  • (Array)

    The range as an array.



13
14
15
# File 'build/mongoid-8.1/lib/mongoid/extensions/range.rb', line 13

def __find_args__
  to_a
end

#mongoizeHash | nil

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

Examples:

Mongoize the object.

range.mongoize

Returns:

  • (Hash | nil)

    The object mongoized or nil.



24
25
26
# File 'build/mongoid-8.1/lib/mongoid/extensions/range.rb', line 24

def mongoize
  ::Range.mongoize(self)
end

#resizable?true

Is this a resizable object.

Examples:

Is this resizable?

range.resizable?

Returns:

  • (true)

    True.



34
35
36
# File 'build/mongoid-8.1/lib/mongoid/extensions/range.rb', line 34

def resizable?
  true
end