Sha256: 9dc9e9acd14d17fa2b5b506fe29532b38ee609ce2fe348af9e4a211d4ab53f1a

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

require 'attr/gather/aggregators/base'
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

1 entries across 1 versions & 1 rubygems

Version Path
attr-gather-1.5.1 lib/attr/gather/aggregators.rb