From: "Iñaki Baz Castillo" Date: 2008-04-16T06:27:14+09:00 Subject: Re: Hash or bidimensional Array when key is case insensitive El Martes, 15 de Abril de 2008, Stefan Rusterholz escribió: > Iñaki Baz Castillo wrote: > > And if I use a Hash I'll do the same: > > > > method = params_hash.find { |param| param[0] =~ /^method$/i }[1] > > Use a hash and lowercase the keys. If you need to preserve the original > casing, do that in the value, e.g. like this: {key.lowercase => [key, > value], ...} Ah ok, it's a good idea :) > Another approach would be a special Key class which is like String but > has #hash and #eql? redefined to work as if the String was lowercased. Thanks but I don't understnad this point. Do you mean extending the Hash class? I don't think so since there is not any Key class. Could you please explain in more detail you suggestion? Thanks a lot for all. -- Iñaki Baz Castillo