class Numeric

Extensions to Numeric.

Public Instance Methods

clamp(min, max) click to toggle source

@return [Numeric] the value clamped between a minimum and maximum value. @param min [Numeric] The minimum permitted value. @param max [Numeric] The maximum permitted value.

# File lib/fmod/core/extensions.rb, line 10
def clamp(min, max)
  [min, self, max].sort[1]
end