Sha256: 5a61b432a8f67b2dfff1f086981d104d8b9a5fbdcc33b91230ea7df1b34fd6db

Contents?: true

Size: 258 Bytes

Versions: 15

Compression:

Stored size: 258 Bytes

Contents

class Hash
  def symbolize_keys
    inject({}) do |result, (key, value)|
      new_key = key.is_a?(String) ? key.to_sym : key
      new_value = value.is_a?(Hash) ? value.symbolize_keys : value
      result[new_key] = new_value
      result
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
propono-1.3.0 lib/propono/helpers/hash.rb
propono-1.2.0 lib/propono/helpers/hash.rb
propono-1.1.3 lib/propono/helpers/hash.rb
propono-1.1.2 lib/propono/helpers/hash.rb
propono-1.1.1 lib/propono/helpers/hash.rb
propono-1.1.0 lib/propono/helpers/hash.rb
propono-1.0.0 lib/propono/helpers/hash.rb
propono-1.0.0.rc3 lib/propono/helpers/hash.rb
propono-1.0.0.rc2 lib/propono/helpers/hash.rb
propono-1.0.0.rc1 lib/propono/helpers/hash.rb
propono-0.11.1 lib/propono/helpers/hash.rb
propono-0.11.0 lib/propono/helpers/hash.rb
propono-0.10.0 lib/propono/helpers/hash.rb
propono-0.9.1 lib/propono/helpers/hash.rb
propono-0.9.0 lib/propono/helpers/hash.rb