module MonoclePrint::Utils

Public Instance Methods

at_least( comparable, min ) click to toggle source
# File lib/monocle-print/utils.rb, line 8
def at_least( comparable, min )
  ( comparable >= min ) ? comparable : min
end
at_most( comparable, max ) click to toggle source
# File lib/monocle-print/utils.rb, line 12
def at_most( comparable, max )
  ( comparable <= max ) ? comparable : max
end
bound( comparable, lower, upper = nil ) click to toggle source
# File lib/monocle-print/utils.rb, line 16
def bound( comparable, lower, upper = nil )
  return lower if comparable < lower
  return comparable unless upper
  return upper if comparable > upper
  return comparable
end