Sha256: 6c402653550d2089111f43716d52b876cdd8f3ad99f76493706c7fdd2440fc61

Contents?: true

Size: 1.69 KB

Versions: 12

Compression:

Stored size: 1.69 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:partition:@docstringIC:YARD::Docstring"�Returns two arrays, the first containing the elements of
<i>enum</i> for which the block evaluates to true, the second
containing the rest.

   (1..6).partition {|i| (i&1).zero?}   #=> [[2, 4, 6], [1, 3, 5]]
:@objectu:YARD::StubProxyEnumerable#partition:
@summary0:	@all"	Returns two arrays, the first containing the elements of
<i>enum</i> for which the block evaluates to true, the second
containing the rest.

   (1..6).partition {|i| (i&1).zero?}   #=> [[2, 4, 6], [1, 3, 5]]



@overload partition
  @yield [ obj ]
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Enumerable#partition;;;IC;	"
;
u;Enumerable#partition;0;
"#@yield [ obj ]
@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["obj:
@text":@tag_name"
yieldo;
;
0;0;["
Array;";"return;0:@parameters[;0:@signature"partition;"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["enum.c0:@namespaceu;Enumerable:
@path"Enumerable#partition;[:@visibility:public:@source"E/*
 *  call-seq:
 *     enum.partition {| obj | block }  => [ true_array, false_array ]
 *
 *  Returns two arrays, the first containing the elements of
 *  <i>enum</i> for which the block evaluates to true, the second
 *  containing the rest.
 *
 *     (1..6).partition {|i| (i&1).zero?}   #=> [[2, 4, 6], [1, 3, 5]]
 *
 */

static VALUE
enum_partition(obj)
    VALUE obj;
{
    VALUE ary[2];

    RETURN_ENUMERATOR(obj, 0, 0);

    ary[0] = rb_ary_new();
    ary[1] = rb_ary_new();
    rb_iterate(rb_each, obj, partition_i, (VALUE)ary);

    return rb_assoc_new(ary[0], ary[1]);
}:@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/partition_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Enumerable/partition_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Enumerable/partition_i.dat