Sha256: 01642067a919a38c833e2db54f8ca77bad772c11dd8f7f7252fd85f74cd34d66

Contents?: true

Size: 394 Bytes

Versions: 8

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

module Bullet
  module Registry
    class Association < Base
      def merge(base, associations)
        @registry.merge!(base => associations)
      end

      def similarly_associated(base, associations)
        @registry.select { |key, value| key.include?(base) && value == associations }
                 .collect(&:first).flatten
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bullet-8.0.0 lib/bullet/registry/association.rb
bullet-7.2.0 lib/bullet/registry/association.rb
bullet-7.1.6 lib/bullet/registry/association.rb
bullet-7.1.5 lib/bullet/registry/association.rb
bullet-7.1.4 lib/bullet/registry/association.rb
bullet-7.1.3 lib/bullet/registry/association.rb
bullet-7.1.2 lib/bullet/registry/association.rb
bullet-7.1.1 lib/bullet/registry/association.rb