Method: Origin::Extensions::Object#__add__

Defined in:
lib/origin/extensions/object.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



18
19
20
# File 'lib/origin/extensions/object.rb', line 18

def __add__(object)
  (object == self) ? self : [ self, object ].flatten.uniq
end