Sha256: c40a65e94b89657de98acc60e6a49fa705443f7109e00ee530c98ee3f1503c51

Contents?: true

Size: 422 Bytes

Versions: 189

Compression:

Stored size: 422 Bytes

Contents

module ActiveSupport #:nodoc:
  module CoreExtensions #:nodoc:
    module Range #:nodoc:
      # Check if Ranges overlap.
      module Overlaps
        # Compare two ranges and see if they overlap eachother
        #  (1..5).overlaps?(4..6) # => true
        #  (1..5).overlaps?(7..9) # => false
        def overlaps?(other)
          include?(other.first) || other.include?(first)
        end
      end
    end
  end
end

Version data entries

189 entries across 156 versions & 24 rubygems

Version Path
abiquo-etk-0.4.33 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.32 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.29 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.25 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.24 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.23 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.22 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.20 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.19 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.18 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.17 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.16 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.15 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.14 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
abiquo-etk-0.4.13 vendor/activesupport-2.3.8/lib/active_support/core_ext/range/overlaps.rb
activesupport-2.3.10 lib/active_support/core_ext/range/overlaps.rb
activesupport-2.3.9 lib/active_support/core_ext/range/overlaps.rb
activesupport-2.3.9.pre lib/active_support/core_ext/range/overlaps.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb