-
Notifications
You must be signed in to change notification settings - Fork 5.4k
MatchData#named_captures: add optional symbolize_names keyword #6952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MatchData#named_captures: add optional symbolize_names keyword #6952
Conversation
For consistency, please consider using |
5104535
to
d837838
Compare
I suggest you add tests to the ruby specs too. |
2280236
to
29d4074
Compare
Did Matz already accept this feature? |
Don't think so. We only discussed it with Kazuki in the context of MatchData#deconstruct_keys here. |
Okay, let me see if I can pull Matz into the discussion. |
Okay, this needs a new issue on |
Opened a ticket https://bugs.ruby-lang.org/issues/19591 (finally). |
6c10db9
to
8e2587d
Compare
Reverted back to |
@palkan do you agree with calling it I spent a few days thinking about whether I want to spend energy on this topic. Honestly, I would like to clarify the naming convention because I don't think JSON |
Yeah, I’m fine with (Also, now I think that |
Yeah, Regarding JSON, I went and looked at the RFC. They actually refer to it as a name:
So in this regard, maybe |
8e2587d
to
516c290
Compare
Feature #19591
Follow-up for #6216.
Example:
The actual functionality has been implemented as a part of
MatchData#deconstruct_keys
, where we needed symbolic keys. This PR proposes to expose it to the#named_captures
method via the optionalsymbolize_names: true | false
keyword argument.