class Hash

Public Instance Methods

transform_keys() { |k), v]| ... } click to toggle source
# File lib/jobly/polyfills/hash.rb, line 15
def transform_keys
  self.map { |k, v| [(yield k), v] }.to_h
end
transform_values() { |v| ... } click to toggle source
# File lib/jobly/polyfills/hash.rb, line 6
def transform_values
  self.each { |k, v| self[k] = yield v }
end