Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/fmod/core/extensions.rb
Overview
Extensions to Numeric.
Instance Method Summary collapse
-
#clamp(min, max) ⇒ Numeric
The value clamped between a minimum and maximum value.
Instance Method Details
#clamp(min, max) ⇒ Numeric
Returns the value clamped between a minimum and maximum value.
10 11 12 |
# File 'lib/fmod/core/extensions.rb', line 10 def clamp(min, max) [min, self, max].sort[1] end |