Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/ctodo.rb

Instance Method Summary collapse

Instance Method Details

#clamp(min, max) ⇒ Object



18
19
20
21
22
# File 'lib/ctodo.rb', line 18

def clamp(min, max)
	return min if self < min
	return max if self > max
	self
end