Sha256: 75c54e391bf999e0e26faf40c65a57218208c1f0544a377942cfb43257a8975f

Contents?: true

Size: 1.71 KB

Versions: 12

Compression:

Stored size: 1.71 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:unshift:@docstringIC:YARD::Docstring"ÀPrepends objects to the front of <i>array</i>.
other elements up one.

   a = [ "b", "c", "d" ]
   a.unshift("a")   #=> ["a", "b", "c", "d"]
   a.unshift(1, 2)  #=> [ 1, 2, "a", "b", "c", "d"]
:@objectu:YARD::StubProxyArray#unshift:
@summary0:	@all"ðPrepends objects to the front of <i>array</i>.
other elements up one.

   a = [ "b", "c", "d" ]
   a.unshift("a")   #=> ["a", "b", "c", "d"]
   a.unshift(1, 2)  #=> [ 1, 2, "a", "b", "c", "d"]


@overload unshift(obj, ...)
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Array#unshift;;;IC;	"
;
u;Array#unshift;0;
"@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["
Array:
@text":@tag_name"return;0:@parameters[[:obj0[:...0;0:@signature"unshift(obj, ...);"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["array.c0:@namespaceu;
Array:
@path"Array#unshift;[:@visibility:public:@source"À/*
 *  call-seq:
 *     array.unshift(obj, ...)  -> array
 *  
 *  Prepends objects to the front of <i>array</i>.
 *  other elements up one.
 *     
 *     a = [ "b", "c", "d" ]
 *     a.unshift("a")   #=> ["a", "b", "c", "d"]
 *     a.unshift(1, 2)  #=> [ 1, 2, "a", "b", "c", "d"]
 */

static VALUE
rb_ary_unshift_m(argc, argv, ary)
    int argc;
    VALUE *argv;
    VALUE ary;
{
    long len = RARRAY(ary)->len;

    if (argc == 0) return ary;

    /* make rooms by setting the last item */
    rb_ary_store(ary, len + argc - 1, Qnil);

    /* sliding items */
    MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
    MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
    
    return ary;
}:@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/unshift_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Array/unshift_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Array/unshift_i.dat