Method: Array#initialize_copy

Defined in:
array.c

#replace(other_array) ⇒ Array

Replaces the contents of self with the contents of other_array, truncating or expanding if necessary.

a = [ "a", "b", "c", "d", "e" ]
a.replace([ "x", "y", "z" ])   #=> ["x", "y", "z"]
a                              #=> ["x", "y", "z"]

Returns:



2162
2163
2164
# File 'array.c', line 2162

static VALUE
rb_ary_replace(copy, orig)
VALUE copy, orig;