maximum(key)
public
Calculates the maximum from the
extracted elements.
payments = [Payment.new(5), Payment.new(15), Payment.new(10)]
payments.maximum(:price)
# File activesupport/lib/active_support/core_ext/enumerable.rb, line 40
def maximum(key)
map(&key).max
end