module Comparable

This method was introduced in ruby 2.4, however this patch will allow this feature to be available in older versions fo ruby

Public Instance Methods

clamp(min, max) click to toggle source
# File lib/core_extensions/comparable.rb, line 5
def clamp(min, max)
  return min if self < min
  return max if self > max
  self
end