Class: Range

Inherits:
Object show all
Defined in:
lib/iron/extensions/range.rb

Instance Method Summary collapse

Instance Method Details

#bound(arg) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/iron/extensions/range.rb', line 3

def bound(arg)
  if arg < min
    return min
  elsif arg > max
    return max
  else
    return arg
  end
end