Sha256: 460c780cd66cdc539b0d101370b911bd8d2119ae03a91b607d709985874b11df

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 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|
        require 'attr/gather/aggregators/deep_merge'

        DeepMerge.new(*args)
      end

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

        ShallowMerge.new(*args)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attr-gather-1.1.0 lib/attr/gather/aggregators.rb
attr-gather-1.0.0 lib/attr/gather/aggregators.rb