Sha256: 053ad1a112a025159b3719ae52d6692f7c9a2f2d4db55fe7cabc8f5537eb0ca4

Contents?: true

Size: 1.8 KB

Versions: 12

Compression:

Stored size: 1.8 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:each_with_index:@docstringIC:YARD::Docstring"�Calls <em>block</em> with two arguments, the item and its index, for
each item in <i>enum</i>.

   hash = Hash.new
   %w(cat dog wombat).each_with_index {|item, index|
     hash[item] = index
   }
   hash   #=> {"cat"=>0, "wombat"=>2, "dog"=>1}
:@objectu:YARD::StubProxyEnumerable#each_with_index:
@summary0:	@all":Calls <em>block</em> with two arguments, the item and its index, for
each item in <i>enum</i>.

   hash = Hash.new
   %w(cat dog wombat).each_with_index {|item, index|
     hash[item] = index
   }
   hash   #=> {"cat"=>0, "wombat"=>2, "dog"=>1}



@overload each_with_index
  @yield [obj, i]
  @return [Enumerator]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Enumerable#each_with_index;;;IC;	"
;
u;Enumerable#each_with_index;0;
")@yield [obj, i]
@return [Enumerator];[;[o:YARD::Tags::Tag
;
0;0:@types["obj"i:
@text":@tag_name"
yieldo;
;
0;0;["Enumerator;";"return;0:@parameters[;0:@signature"each_with_index;"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["enum.c0:@namespaceu;Enumerable:
@path"Enumerable#each_with_index;[:@visibility:public:@source"0/*
 *  call-seq:
 *     enum.each_with_index {|obj, i| block }  -> enum
 *
 *  Calls <em>block</em> with two arguments, the item and its index, for
 *  each item in <i>enum</i>.
 *
 *     hash = Hash.new
 *     %w(cat dog wombat).each_with_index {|item, index|
 *       hash[item] = index
 *     }
 *     hash   #=> {"cat"=>0, "wombat"=>2, "dog"=>1}
 *
 */

static VALUE
enum_each_with_index(obj)
    VALUE obj;
{
    VALUE memo;

    RETURN_ENUMERATOR(obj, 0, 0);

    memo = 0;
    rb_iterate(rb_each, obj, each_with_index_i, (VALUE)&memo);
    return obj;
}:@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/Enumerable/each_with_index_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Enumerable/each_with_index_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Enumerable/each_with_index_i.dat