Brian Candler
2/6/2007 12:50:00 PM
On Tue, Feb 06, 2007 at 09:34:02PM +0900, Martin DeMello wrote:
> On 2/6/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> >Hi,
> >
> >In message "Re: Hash#rekey"
> > on Mon, 5 Feb 2007 07:34:49 +0900, "Trans" <transfire@gmail.com>
> > writes:
> >
> >|I used 'normalize_keys' for while, but how doesn't 'rekey' fit the
> >|behavior? The hash is being rekey'd.
> >
> >For me, 'rekey' is meaningless. Coined word need guessing, which is
> >considered harmful unless it is accepted by many.
>
> alter_key(s), perhaps
# existing
a = [:one, :two, :three]
a.map! { |k| k.to_s }
puts a.inspect
# by analogy
h = [:one=>1, :two=>2, :three=>3]
h.map_keys! { |k| k.to_s }
puts h.inspect