Sha256: ce90cbb2163a1d0ef35ad2cf0099f8b65b38e16a938cc5105a0dfb18d0fbcca1

Contents?: true

Size: 175 Bytes

Versions: 17

Compression:

Stored size: 175 Bytes

Contents

# Extend Range class to include clip (used to implement processing constrain)
class Range #:nodoc:
  def clip(n)
    return n if cover?(n)
    (n < min) ? min : max
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
ruby-processing-2.7.1 lib/ruby-processing/helpers/range.rb
ruby-processing-2.7.0 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.18 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.17 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.16 lib/ruby-processing/helpers/range.rb
jruby_art-0.5.0 lib/jruby_art/helpers/range.rb
ruby-processing-2.6.15 lib/ruby-processing/helpers/range.rb
jruby_art-0.4.2 lib/jruby_art/helpers/range.rb
ruby-processing-2.6.14 lib/ruby-processing/helpers/range.rb
jruby_art-0.4.0 lib/jruby_art/helpers/range.rb
jruby_art-0.3.1.pre lib/jruby_art/helpers/range.rb
ruby-processing-2.6.13 lib/ruby-processing/helpers/range.rb
jruby_art-0.3.0.pre lib/jruby_art/helpers/range.rb
ruby-processing-2.6.12 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.11 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.10 lib/ruby-processing/helpers/range.rb
ruby-processing-2.6.9 lib/ruby-processing/helpers/range.rb