| Module | Origin::Extensions::Array |
| In: |
lib/origin/extensions/array.rb
|
Return the object as an array.
@example Get the array.
[ 1, 2 ].__array__
@return [ Array ] self
@since 1.0.0
Makes a deep copy of the array, deep copying every element inside the array.
@example Get a deep copy of the array.
[ 1, 2, 3 ].__deep_copy__
@return [ Array ] The deep copy of the array.
@since 1.0.0
Get the object as expanded.
@example Get the object expanded.
obj.__expand_complex__
@return [ Array ] The expanded array.
@since 1.1.0
Gets the array as options in the proper format to pass as MongoDB sort criteria.
@example Get the array as sorting options.
[ :field, 1 ].__sort_option__
@return [ Hash ] The array as sort criterion.
@since 1.0.0
Get the array as a sort pair.
@example Get the array as field/direction pair.
[ field, 1 ].__sort_pair__
@return [ Hash ] The field/direction pair.
@since 1.0.0
Update all the values in the hash with the provided block.
@example Update the values in place.
[ 1, 2, 3 ].update_values(&:to_s)
@param [ Proc ] block The block to execute on each value.
@return [ Array ] the array.
@since 1.0.0