Sha256: 89fefec87b78e9f63f8f98d45ec63eabb6f3336b5ef9826a14e4a277fda728c6

Contents?: true

Size: 447 Bytes

Versions: 29

Compression:

Stored size: 447 Bytes

Contents

module Shoulda
  module Matchers
    module Integrations
      # @private
      module Inclusion
        def include_into(mod, *other_mods, &block)
          mods_to_include = other_mods.dup
          mods_to_extend = other_mods.dup

          if block
            mods_to_include << Module.new(&block)
          end

          mod.__send__(:include, *mods_to_include)
          mod.extend(*mods_to_extend)
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
shoulda-matchers-6.4.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-6.3.1 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-6.3.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-6.2.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-6.1.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-6.0.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-5.3.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-5.2.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-5.1.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-5.0.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-5.0.0.rc1 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.5.1 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.5.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.4.1 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.4.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.3.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.2.0 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.1.2 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.1.1 lib/shoulda/matchers/integrations/inclusion.rb
shoulda-matchers-4.1.0 lib/shoulda/matchers/integrations/inclusion.rb