Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/mtk_framework/core_extensions/hash/rename_keys.rb

Instance Method Summary collapse

Instance Method Details

#rename_keys(keys_replacement_hash) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/mtk_framework/core_extensions/hash/rename_keys.rb', line 4

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

    keys_replacement_hash[key]
  end
end