Method: Mongoid::Criteria::Queryable::Extensions::Array#__add__

Defined in:
lib/mongoid/criteria/queryable/extensions/array.rb

#__add__(object) ⇒ Object

Combine the two objects using the add strategy.

Examples:

Add the object to the array.

[ 1, 2, 3 ].__add__(4)

Parameters:

  • object (Object)

    The object to add.

Returns:

  • (Object)

    The result of the add.

Since:

  • 1.0.0



22
23
24
# File 'lib/mongoid/criteria/queryable/extensions/array.rb', line 22

def __add__(object)
  object.__add_from_array__(self)
end