Module Origin::Extensions::Object
In: lib/origin/extensions/object.rb

This module contains additional object behaviour.

Methods

Classes and Modules

Module Origin::Extensions::Object::ClassMethods

Public Instance methods

Combine the two objects using the add strategy.

@example Add the object to the array.

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

@param [ Object ] object The object to add.

@return [ Object ] The result of the add.

@since 1.0.0

Merge this object into the provided array.

@example Merge the object into the array.

  4.__add_from_array__([ 1, 2 ])

@param [ Array ] value The array to add to.

@return [ Array ] The merged object.

@since 1.0.0

Get the object as an array.

@example Get the object as an array.

  4.__array__

@return [ Array ] The wrapped object.

@since 1.0.0

Deep copy the object. This is for API compatibility, but needs to be overridden.

@example Deep copy the object.

  1.__deep_copy__

@return [ Object ] self.

@since 1.0.0

Get the object as expanded.

@example Get the object expanded.

  obj.__expand_complex__

@return [ Object ] self.

@since 1.0.5

Combine the two objects using the intersect strategy.

@example Add the object to the array.

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

@param [ Object ] object The object to intersect.

@return [ Array ] The result of the intersect.

@since 1.0.0

Merge this object into the provided array.

@example Merge the object into the array.

  4.__intersect_from_array__([ 1, 2 ])

@param [ Array ] value The array to intersect to.

@return [ Array ] The merged object.

@since 1.0.0

Merge this object into the provided array.

@example Merge the object into the array.

  4.__intersect_from_object__([ 1, 2 ])

@param [ Object ] value The value to intersect to.

@return [ Array ] The merged object.

@since 1.0.0

Combine the two objects using the union strategy.

@example Add the object to the array.

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

@param [ Object ] object The object to union.

@return [ Array ] The result of the union.

@since 1.0.0

Merge this object into the provided array.

@example Merge the object into the array.

  4.__union_from_object__([ 1, 2 ])

@param [ Object ] value The value to union to.

@return [ Array ] The merged object.

@since 1.0.0

Is the object a regex.

@example Is the object a regex?

  obj.regexp?

@return [ false ] Always false.

@since 1.0.4

[Validate]