Sha256: 5992a181d7ffb2edb42680d3bf76d164650500d6585709373abdab20ed415e75

Contents?: true

Size: 227 Bytes

Versions: 228

Compression:

Stored size: 227 Bytes

Contents

class Range
  # Compare two ranges and see if they overlap each other
  #  (1..5).overlaps?(4..6) # => true
  #  (1..5).overlaps?(7..9) # => false
  def overlaps?(other)
    cover?(other.first) || other.cover?(first)
  end
end

Version data entries

228 entries across 219 versions & 23 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/range/overlaps.rb
activesupport-4.2.11.3 lib/active_support/core_ext/range/overlaps.rb
activesupport-4.2.11.2 lib/active_support/core_ext/range/overlaps.rb
motion-support-1.2.1 motion/core_ext/range/overlaps.rb
motion-support-1.1.1 motion/core_ext/range/overlaps.rb
sigterm_extensions-0.0.4 lib/sigterm_extensions/core_ext/range/overlaps.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/range/overlaps.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/range/overlaps.rb
activesupport-5.1.7 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.1.7.rc1 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.1.6.2 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.0.7.2 lib/active_support/core_ext/range/overlaps.rb
activesupport-4.2.11.1 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.1.6.1 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.0.7.1 lib/active_support/core_ext/range/overlaps.rb
activesupport-4.2.11 lib/active_support/core_ext/range/overlaps.rb
motion-support-1.2.0 motion/core_ext/range/overlaps.rb
activesupport-5.1.6 lib/active_support/core_ext/range/overlaps.rb
activesupport-5.0.7 lib/active_support/core_ext/range/overlaps.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/core_ext/range/overlaps.rb