Sha256: 4728911d9b7cf609634b7f8b1e988a9671ef093014e7c4e3c5048bc4b2be0bdc

Contents?: true

Size: 277 Bytes

Versions: 7

Compression:

Stored size: 277 Bytes

Contents

# frozen_string_literal: true

module Nsrr
  module Helpers
    # Converts hash with string keys into hash with keys as symbols.
    class HashHelper
      def self.symbolize_keys(hash)
        hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nsrr-0.4.0 lib/nsrr/helpers/hash_helper.rb
nsrr-0.4.0.rc lib/nsrr/helpers/hash_helper.rb
nsrr-0.4.0.beta1 lib/nsrr/helpers/hash_helper.rb
nsrr-0.3.0 lib/nsrr/helpers/hash_helper.rb
nsrr-0.3.0.rc lib/nsrr/helpers/hash_helper.rb
nsrr-0.3.0.beta2 lib/nsrr/helpers/hash_helper.rb
nsrr-0.3.0.beta1 lib/nsrr/helpers/hash_helper.rb