Method: Enumerable#min_by

Defined in:
enum.c

#min_by {|obj| ... } ⇒ Object

Returns the object in enum that gives the minimum value from the given block.

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

Yields:

  • (obj)

Returns:



1324
1325
1326
# File 'enum.c', line 1324

static VALUE
enum_min_by(obj)
VALUE obj;