Sha256: e199ede29f0a2c59950f2bae72e6710a73da2b8b68b7c52cfcf53e02abb6eb37

Contents?: true

Size: 1.94 KB

Versions: 12

Compression:

Stored size: 1.94 KB

Contents

o:$YARD::CodeObjects::MethodObject:@scope:
instance:@visibility:public:
@pathI"Enumerable#max_by:EF:@parameters[:@files[[I"enum.c;T0:@current_file_has_commentsF:
@name:max_by:@source_type:c:
@tags[:@docstringIC:YARD::Docstring"ÜReturns the object in <i>enum</i> that gives the maximum
value from the given block.

If no block is given, an enumerator is returned instead.

   a = %w(albatross dog horse)
   a.max_by {|x| x.length }   #=> "albatross";F:@objectIu:YARD::StubProxyEnumerable#max_by;F:
@summary0:@ref_tags[;[o:YARD::Tags::OverloadTag
:@tag_nameI"
overload;F:
@text0;;:@types0:@signatureI"max_by;F;IC;";F;Iu;Enumerable#max_by;F;0;[;[o:YARD::Tags::Tag
;I"
yield;F;I";F;0;[I"obj;F;0o;
;I"return;F;I";F;0;[I"Object;F;0:	@allI""@yield [obj]
@return [Object];F;[;Iu;Enumerable#max_by;Fo;
;I"
overload;F;0;;;0;I"max_by;F;IC;";F;Iu;Enumerable#max_by;F;0;[;[; I";F;[;Iu;Enumerable#max_by;F; I""Returns the object in <i>enum</i> that gives the maximum
value from the given block.

If no block is given, an enumerator is returned instead.

   a = %w(albatross dog horse)
   a.max_by {|x| x.length }   #=> "albatross"


@overload max_by
  @yield [obj]
  @return [Object]
@overload max_by;F:@namespaceIu;Enumerable;F:@docstring_extra0:@sourceI"H/*
 *  call-seq:
 *     enum.max_by {|obj| block }   -> obj
 *     enum.max_by                  -> an_enumerator
 *
 *  Returns the object in <i>enum</i> that gives the maximum
 *  value from the given block.
 *
 *  If no block is given, an enumerator is returned instead.
 *
 *     a = %w(albatross dog horse)
 *     a.max_by {|x| x.length }   #=> "albatross"
 */

static VALUE
enum_max_by(VALUE obj)
{
    VALUE memo[2];

    RETURN_ENUMERATOR(obj, 0, 0);

    memo[0] = Qundef;
    memo[1] = Qnil;
    rb_block_call(obj, id_each, 0, 0, max_by_i, (VALUE)memo);
    return memo[1];
};F

Version data entries

12 entries across 12 versions & 2 rubygems

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