Method: SimpleJSONAPIClient::Utils.symbolize_keys
- Defined in:
- lib/simple_jsonapi_client/utils.rb
.symbolize_keys(hash) ⇒ Object
Implementation adapted from ActiveSupport Copyright © 2005-2019 David Heinemeier Hansson github.com/rails/rails/blob/b9ca94caea2ca6a6cc09abaffaad67b447134079/activesupport/lib/active_support/core_ext/hash/keys.rb
7 8 9 10 11 12 13 |
# File 'lib/simple_jsonapi_client/utils.rb', line 7 def symbolize_keys(hash) result = {} hash.each_key do |key| result[(key.to_sym rescue key)] = hash[key] end result end |