What\'s the (fastest/cleanest/straightforward) way to convert all keys in a hash from strings to symbols in Ruby?
This would be handy when parsing YAML.
Since Ruby 2.5.0 you can use Hash#transform_keys or Hash#transform_keys!.
Ruby 2.5.0
{'a' => 1, 'b' => 2}.transform_keys(&:to_sym) #=> {:a => 1, :b => 2}