From: "ioquatix (Samuel Williams) via ruby-core" Date: 2023-04-11T23:41:05+00:00 Subject: [ruby-core:113192] [Ruby master Feature#19591] Add symbolize_keys to MatchData#named_captures Issue #19591 has been updated by ioquatix (Samuel Williams). LGTM! ---------------------------------------- Feature #19591: Add symbolize_keys to MatchData#named_captures https://bugs.ruby-lang.org/issues/19591#change-102730 * Author: palkan (Vladimir Dementyev) * Status: Open * Priority: Normal ---------------------------------------- This feature is a follow-up for MatchData#deconstruct_keys (see https://github.com/ruby/ruby/pull/6216). Example: ```ruby m = /(?.)(?.)/.match("01") # => # m.named_captures #=> {"a" => "1"} m.named_captures(symbolize_keys: true) #=> {:a => "1"} ``` The underlying (C) functionality has been already implemented. The proposal is to expose it via the optional `symbolize_keys: true | false` keyword argument. PR is attached: https://github.com/ruby/ruby/pull/6952 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/