
Issue #19607 has been updated by ioquatix (Samuel Williams). I did some more research. The actual JSON RFC https://www.rfc-editor.org/rfc/rfc8259 refers to `name/value` pairs. So `symbolize_names` is not so strange for `JSON.parse`. In the YAML RFC https://yaml.org/spec/1.2.2/#mapping refers to it as `key/value` pairs. So `symbolize_keys` can be more natural, according to the spec, but is inconsistent with JSON. In addition, YAML keys can be different data types e.g. integer, string, symbol, timestamp. In this case, it's not symbolizing all the keys, but just ones which represent names (strings). So, maybe that's also acceptable. Therefore, I think that those option names are unrelated to `symbolize_keys` as a method name. But we should not use those options as justification, and instead look for the specific circumstances in each case. That being said, consistency is also useful. ---------------------------------------- Feature #19607: Introduce `Hash#symbolize_keys`. https://bugs.ruby-lang.org/issues/19607#change-102847 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal ---------------------------------------- This is a very common operation. It can currently be implemented using `Hash#transform_keys(&:to_sym)`. It's currently provided by Rails as `Hash#symbolize_keys` and `Hash#symbolize_keys!`. Proposed implementation is identical to Rails implementation: https://github.com/rails/rails/blob/539144d2d61770dab66c8643e744441e52538e09... For completeness we could also consider adding `stringify_keys` but I think that's less frequently used. -- https://bugs.ruby-lang.org/