Hi,
On 12/3/05, Onur Turgay
<onurturgay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I want to typecast an object of HashWithIndifferentAccess (params) to Hash.
> Whats the way of doing this (except each?)
There is no typecasting in Ruby. The Hash.[] method returns a new
Hash from the object you pass in:
params[:action] # => ''index''
params.class # => HashWithIndifferentAccess
strict_params = Hash[params]
strict_params.class # => Hash
strict_params[:action] # => nil
strict_params[''action''] # => ''index''
Sam