module Lazier::Math::ClassMethods
General methods.
Public Instance Methods
max(*args)
click to toggle source
Returns the maximum value between the arguments.
@param args [Array] A list of objects to compare (with the `>` operator). @return [Object] The maximum value or `nil` (if the list is empty).
# File lib/lazier/math.rb, line 25 def max(*args) args.ensure_array(default: [], no_duplicates: true, compact: true, flatten: true).max end
min(*args)
click to toggle source
Returns the minimum value between the arguments.
@param args [Array] A list of objects to compare (with the `<` operator). @return [Object] The minimum value or `nil` (if the list is empty).
# File lib/lazier/math.rb, line 17 def min(*args) args.ensure_array(default: [], no_duplicates: true, compact: true, flatten: true).min end