Module: PactBroker::Client::StringToSymbol

Included in:
BaseClient
Defined in:
lib/pact_broker/client/base_client.rb

Instance Method Summary collapse

Instance Method Details

#string_keys_to_symbols(hash) ⇒ Object

Only works for one level, not recursive!



16
17
18
19
20
# File 'lib/pact_broker/client/base_client.rb', line 16

def string_keys_to_symbols hash
  hash.keys.each_with_object({}) do | key, new_hash |
    new_hash[key.to_sym] = hash[key]
  end
end