Project

General

Profile

Actions

Feature #17315

open

Hash #transform

Added by dsisnero (Dominic Sisneros) about 4 years ago. Updated about 4 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:100765]

Description

Add new methods to transform or transform! both the keys and the values of a hash.
#7793

h = {'name' => 'dominic ', 'email' => 'dominic.mail.com '}
h.transform!{|k,v| [k.to_sym, v.strip]}
h # => {name: 'dominic', email: 'dominic.mail.com'}
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0