Class: Range

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-processing/helpers/range.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#clip(n) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/ruby-processing/helpers/range.rb', line 2

def clip(n)
  if cover?(n)
    n
  elsif n < min
    min
  else
    max
  end
end