method

min

v1_9_1_378 - Show latest stable - Class: Enumerable
min()
public

Returns the object in enum with the minimum value. The first form assumes all objects implement Comparable; the second uses the block to return a <=> b.

a = %w(albatross dog horse)
a.min                                  #=> "albatross"
a.min {|a,b| a.length <=> b.length }   #=> "dog"

2Notes

See max

Mange · Feb 16, 20091 thank

See max for comments and more usage examples.

Video Explanation For min and max

MattStopa · Mar 14, 2012