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

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

#__add__(object) ⇒ Hash

Add an object to a hash using the merge strategies.

Examples:

Add an object to a hash.

{ field: value }.__add__({ field: other_value })

Parameters:

  • object (Hash)

    The other hash to add.

Returns:

  • (Hash)

    The hash with object added.



20
21
22
# File 'lib/mongoid/criteria/queryable/extensions/hash.rb', line 20

def __add__(object)
  apply_strategy(:__add__, object)
end