Sha256: ab809337bce1f2a74adbb83574184e0de154453fd556c6cb2af1ed705d78276b

Contents?: true

Size: 1.97 KB

Versions: 12

Compression:

Stored size: 1.97 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:replace:@docstringIC:YARD::Docstring"Replaces the contents of <i>self</i> with the contents of
<i>other_array</i>, truncating or expanding if necessary.

   a = [ "a", "b", "c", "d", "e" ]
   a.replace([ "x", "y", "z" ])   #=> ["x", "y", "z"]
   a                              #=> ["x", "y", "z"]
:@objectu:YARD::StubProxyArray#replace:
@summary0:	@all"6Replaces the contents of <i>self</i> with the contents of
<i>other_array</i>, truncating or expanding if necessary.

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


@overload replace(other_array)
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Array#replace;;;IC;	"
;
u;Array#replace;0;
"@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["
Array:
@text":@tag_name"return;0:@parameters[[:other_array0;0:@signature"replace(other_array);"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["array.c0:@namespaceu;
Array:
@path"Array#replace;[:@visibility:public:@source"8/*
 *  call-seq:
 *     array.replace(other_array)  -> array
 *  
 *  Replaces the contents of <i>self</i> with the contents of
 *  <i>other_array</i>, truncating or expanding if necessary.
 *     
 *     a = [ "a", "b", "c", "d", "e" ]
 *     a.replace([ "x", "y", "z" ])   #=> ["x", "y", "z"]
 *     a                              #=> ["x", "y", "z"]
 */

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

    rb_ary_modify(copy);
    orig = to_ary(orig);
    if (copy == orig) return copy;
    shared = ary_make_shared(orig);
    if (RARRAY(copy)->ptr && !FL_TEST(copy, ELTS_SHARED))
    free(RARRAY(copy)->ptr);
    RARRAY(copy)->ptr = RARRAY(orig)->ptr;
    RARRAY(copy)->len = RARRAY(orig)->len;
    RARRAY(copy)->aux.shared = shared;
    FL_SET(copy, ELTS_SHARED);

    return copy;
}:@source_type:c

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
pry-doc-0.4.4 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Array/replace_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Array/replace_i.dat