From: "Eric I." Date: 2007-11-23T03:50:00+09:00 Subject: Re: How to give depth to arrays? On Nov 22, 1:39 pm, Sebastian Hungerecker wrote: > quoth Chris Morales: > > >>>> the first number is the base depth Thank you, Sebastian! I lost track of that. OK, here we go, then: class Array def depthen base_depth = first result = [] each do |depth| array_end = result (depth - base_depth).times do array_end << [] unless array_end.last.kind_of? Array array_end = array_end.last end array_end << depth end result end end Eric ==== Interested in hands-on, on-site Ruby training? See http://LearnRuby.com for information about a well-reviewed class.