On Thu, Feb 25, 2010 at 8:26 AM, Robert Klemme
<shortcutter / googlemail.com> wrote:

> def classify(o)
> case o
> when Hash
>  h = {}
>  o.each {|k,v| h[k] = classify(v)}
>  h
> when Array
>  o.map {|v| classify(v)}
> else
>  o.class
> end
> end
>
> while you need to do a more complicated code change.

Yeah, much nicer.