Class: Range
- Inherits:
-
Object
- Object
- Range
- Defined in:
- lib/ruby-processing/helpers/range.rb
Overview
Extend Range class to include clip (used to implement processing constrain)
Instance Method Summary collapse
-
#clip(n) ⇒ Object
:nodoc:.
Instance Method Details
#clip(n) ⇒ Object
:nodoc:
3 4 5 6 |
# File 'lib/ruby-processing/helpers/range.rb', line 3 def clip(n) return n if cover?(n) (n < min) ? min : max end |