Cleanup i-mic-fps.rb a bit

This commit is contained in:
2019-09-26 08:24:32 -05:00
parent eb7a7fc6d6
commit e41a2b6524
3 changed files with 60 additions and 58 deletions

18
lib/ext/numeric.rb Normal file
View File

@@ -0,0 +1,18 @@
if RUBY_VERSION < "2.5.0"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts "|NOTICE| Ruby is #{RUBY_VERSION} not 2.5.0+..............................|Notice|"
puts "|NOTICE| Monkey Patching Numeric to add required '.clamp' method.|Notice|"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts
class Numeric
def clamp(min, max)
if self < min
min
elsif self > max
max
else
return self
end
end
end
end