Sha256: 53827573fb8facf331698c6cc71c06b4bdf30bbf39782f72dbccf6f36d325c3f
Contents?: true
Size: 534 Bytes
Versions: 9
Compression:
Stored size: 534 Bytes
Contents
module Polyfill module V2_5 module Hash def slice(*keys) keys.each_with_object({}) do |k, acc| acc[k] = self[k] if key?(k) end end def transform_keys unless block_given? return ::Enumerator.new(keys.size) do |yielder| each_with_object({}) do |(k, v), acc| acc[yielder.yield(k)] = v end end end each_with_object({}) do |(k, v), acc| acc[yield(k)] = v end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems