Sha256: 6e616f406080772328ebcddc1d5dd3255b180d50c5fb08cc4832083dde5ec484

Contents?: true

Size: 1.91 KB

Versions: 12

Compression:

Stored size: 1.91 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:select:@docstringIC:YARD::Docstring"Invokes the block passing in successive elements from <i>array</i>,
returning an array containing those elements for which the block
returns a true value (equivalent to <code>Enumerable#select</code>).

   a = %w{ a b c d e f }
   a.select {|v| v =~ /[aeiou]/}   #=> ["a", "e"]
:@objectu:YARD::StubProxyArray#select:
@summary0:	@all"JInvokes the block passing in successive elements from <i>array</i>,
returning an array containing those elements for which the block
returns a true value (equivalent to <code>Enumerable#select</code>).

   a = %w{ a b c d e f }
   a.select {|v| v =~ /[aeiou]/}   #=> ["a", "e"]


@overload select
  @yield [item]
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Array#select;;;IC;	"
;
u;Array#select;0;
""@yield [item]
@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["	item:
@text":@tag_name"
yieldo;
;
0;0;["
Array;";"return;0:@parameters[;0:@signature"select;"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["array.c0:@namespaceu;
Array:
@path"Array#select;[:@visibility:public:@source"È/*
 *  call-seq:
 *     array.select {|item| block } -> an_array
 *  
 *  Invokes the block passing in successive elements from <i>array</i>,
 *  returning an array containing those elements for which the block
 *  returns a true value (equivalent to <code>Enumerable#select</code>).
 *     
 *     a = %w{ a b c d e f }
 *     a.select {|v| v =~ /[aeiou]/}   #=> ["a", "e"]
 */

static VALUE
rb_ary_select(ary)
    VALUE ary;
{
    VALUE result;
    long i;

    RETURN_ENUMERATOR(ary, 0, 0);
    result = rb_ary_new2(RARRAY(ary)->len);
    for (i = 0; i < RARRAY(ary)->len; i++) {
    if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
        rb_ary_push(result, rb_ary_elt(ary, i));
    }
    }
    return result;
}:@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/select_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Array/select_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Array/select_i.dat