Sha256: 3537709d2d23febe5d471adfe13864d2c32a2dd63a971e476481e70b039197e5

Contents?: true

Size: 697 Bytes

Versions: 7

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

require 'attr/gather/concerns/registrable'

module Attr
  module Gather
    # Namespace for aggregators
    module Aggregators
      extend Registrable

      # The default aggregator if none is specified
      #
      # @return [Attr::Gather::Aggregators::DeepMerge]
      def self.default
        @default = resolve(:deep_merge)
      end

      register(:deep_merge) do |*args, **opts|
        require 'attr/gather/aggregators/deep_merge'

        DeepMerge.new(*args, **opts)
      end

      register(:shallow_merge) do |*args, **opts|
        require 'attr/gather/aggregators/shallow_merge'

        ShallowMerge.new(*args, **opts)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
attr-gather-1.4.0 lib/attr/gather/aggregators.rb
attr-gather-1.2.1 lib/attr/gather/aggregators.rb
attr-gather-1.3.0 lib/attr/gather/aggregators.rb
attr-gather-1.2.0 lib/attr/gather/aggregators.rb
attr-gather-1.1.3 lib/attr/gather/aggregators.rb
attr-gather-1.1.2 lib/attr/gather/aggregators.rb
attr-gather-1.1.1 lib/attr/gather/aggregators.rb