method
minmax_by

minmax_by()
public
Returns two elements array array containing the objects in enum that gives the minimum and maximum values respectively from the given block.
a = %w(albatross dog horse) a.minmax_by {|x| x.length } #=> ["dog", "albatross"]