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