From: "Jesús Gabriel y Galán" Date: 2010-10-21T19:52:21+09:00 Subject: Re: about handling args in block On Thu, Oct 21, 2010 at 12:38 PM, salamond wrote: > Thanks Jeremy, wax, and robert. > > I wanner do this because this tree may not be a binary tree. > What if a node could link to a dozen nodes. In that case it's probable that you have another level of indirection, and not have each child node directly as an instance variable. More likely something like: class Node attr_reader :children def initialize @children = [] end def add_children node @children << children end def remove_leaves @children.delete_if {|node| node.leaf?} end end Missing some pieces, but you get the idea... Jesus.