Sha256: b39cec81fe0d745f0dfdc7aae499f0d90cb11b7167bd1d664b45d9e83493c7c5

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

module KittikRb
  module Cursor
    module CorePatches
      module HashPatch
        refine Hash do
          # From ActiveSupport v5.0.0.beta3
          def slice(*keys)
            if respond_to?(:convert_key, true)
              keys.map! { |key| convert_key(key) }
            end

            keys.each_with_object(self.class.new) do |k, hash|
              hash[k] = self[k] if has_key?(k)
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kittikrb-cursor-3.0.1 lib/kittikrb/cursor/core_patches/hash.rb