Sha256: 7a36f087e0b2a8b37b5746cf476bfc05ec35e7c743d612ff704544c43c6435a1

Contents?: true

Size: 217 Bytes

Versions: 10

Compression:

Stored size: 217 Bytes

Contents

# frozen_string_literal: true

class Hash
  def rename_keys(keys_replacement_hash)
    transform_keys do |key|
      next key unless keys_replacement_hash.key?(key)

      keys_replacement_hash[key]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mtk_framework-1.0.1 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-1.0.0 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.7 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.6 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.5 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.4 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.3 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.2 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.1 lib/mtk_framework/core_extensions/hash/rename_keys.rb
mtk_framework-0.1.0 lib/mtk_framework/core_extensions/hash/rename_keys.rb