Method: Highway::Utilities.hash_map

Defined in:
lib/highway/utilities.rb

.hash_map(subject, &transform) ⇒ Hash

Map pairs of keys and values and combine them again into a Hash.

Parameters:

  • subject (Hash)

    An input hash.

  • transform (Proc)

    A transformation block.

Returns:

  • (Hash)


20
21
22
# File 'lib/highway/utilities.rb', line 20

def self.hash_map(subject, &transform)
  Hash[subject.map(&transform)]
end