Sha256: 35db6f82db99128f0b391b85b186729ab37cd5ba41fac323971a1bc0ce60e117

Contents?: true

Size: 257 Bytes

Versions: 24

Compression:

Stored size: 257 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'
require 'set'

Array.class_eval do
  # @return [Boolean]
  def overlaps?(other)
    !(self & Array(other)).empty?
  end
end

Set.class_eval do
  extend Forwardable

  def_delegators :to_a, :overlaps?
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
ruby-rails-extensions-2.1.2 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.2.pre.pre.pre.1 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/overlaps.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/overlaps.rb