Sha256: 99b454cf830313f039d4cfe6e42f0d0a36e58e521b1b7eaa32775c0fb5837520

Contents?: true

Size: 506 Bytes

Versions: 13

Compression:

Stored size: 506 Bytes

Contents

module AchClient
  class Helpers
    class Utils
      # Given a list of hashes where the hashes values are lists, merge the
      #   list of hashes by appending the two lists when there is a key
      #   collision
      # @param hashlist [Array(Hash{String => Array})]
      def self.hashlist_merge(hashlist)
        hashlist.reduce do |map, record|
          map.merge(record) do |_key, left_value, right_value|
            left_value + right_value
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ach_client-5.2.0 lib/ach_client/helpers/utils.rb
ach_client-5.1.0 lib/ach_client/helpers/utils.rb
ach_client-5.0.0 lib/ach_client/helpers/utils.rb
ach_client-4.0.0 lib/ach_client/helpers/utils.rb
ach_client-3.1.0 lib/ach_client/helpers/utils.rb
ach_client-3.0.0 lib/ach_client/helpers/utils.rb
ach_client-2.1.0 lib/ach_client/helpers/utils.rb
ach_client-2.0.0 lib/ach_client/helpers/utils.rb
ach_client-1.1.0 lib/ach_client/helpers/utils.rb
ach_client-1.0.3 lib/ach_client/helpers/utils.rb
ach_client-1.0.2 lib/ach_client/helpers/utils.rb
ach_client-1.0.1 lib/ach_client/helpers/utils.rb
ach_client-1.0.0 lib/ach_client/helpers/utils.rb