Project

General

Profile

Actions

Feature #13045

closed

Passing a Hash with String keys as keyword arguments

Added by ch1c0t (Anatoly Chernow) over 7 years ago. Updated about 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:78695]

Description

To the following method

def new request:, response:
end

I'd like to be able to pass both

hash_with_symbol_keys = { request: another_hash, response: another_hash2 }
hash_with_string_keys = { 'request' => another_hash, 'response' => another_hash2 }

I would make a lot cleaner parsing many things returned with string keys(like the output of YAML.load).

If you don't like the above feature, could you please at least consider adding Hash#symbolize_keys(like you did with Hash#transform_values)?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0