Sha256: 9f912f6c41197bcbf2a5ef7cc40d2b66eda33349cb44be39e3e3eb37ac4a1d59
Contents?: true
Size: 990 Bytes
Versions: 38
Compression:
Stored size: 990 Bytes
Contents
# encoding: utf-8 # # This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun_panda@me.com>. # Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php. # module Lazier # Utility methods for Math module. module Math extend ::ActiveSupport::Concern # General methods. module ClassMethods # Returns the minimum value in the arguments # # @param args [Array] A collection of object to compare (with the `<` operator). # @return [Object] The minimum value or `nil` (if the collection is empty). def min(*args) args.ensure_array.flatten.min end # Returns the maximum value in the arguments # # @param args [Array] A collection of object to compare (with the `>` operator). # @return [Object] The maximum value or `nil` (if the collection is empty). def max(*args) args.ensure_array.flatten.max end end end end
Version data entries
38 entries across 38 versions & 1 rubygems