Sha256: 3873de01286818421c23a9bd39ac6e5c4d11c80b25f1289ed3e1bb49567f49ce

Contents?: true

Size: 554 Bytes

Versions: 25

Compression:

Stored size: 554 Bytes

Contents

module Filestack
  # A helper class for the purpose of implementing a symbolize_keys method
  # similar to ActiveSupport's symbolize_keys.
  class Hash

    # Convert a hash to use symbolized keys.
    #
    # @param [Hash]   to_symbolize    The hash which contains the keys to be
    #                                 symbolized
    #
    # @return [Hash]
    def self.symbolize_keys(to_symbolize)
      symbolized = {}
      to_symbolize.each_key do |key|
        symbolized[key.to_sym] = to_symbolize[key]
      end
      symbolized
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
filestack-2.9.7 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.6 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.5 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.4 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.3 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.2 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.1 lib/filestack/core_ext/hash/keys.rb
filestack-2.9.0 lib/filestack/core_ext/hash/keys.rb
filestack-2.8.1 lib/filestack/core_ext/hash/keys.rb
filestack-2.8.0 lib/filestack/core_ext/hash/keys.rb
filestack-2.7.0 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.7 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.6 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.5 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.4 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.3 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.2 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.1 lib/filestack/core_ext/hash/keys.rb
filestack-2.6.0 lib/filestack/core_ext/hash/keys.rb
filestack-2.5.4 lib/filestack/core_ext/hash/keys.rb