From: Brad Cox Date: 2002-04-13T07:46:41+09:00 Subject: Rudy idiom for enumeranting parents of a node? I need to enumerate the parentage chain of the nodes in a doubly-linked tree. No problem in C/Java, but I'm still too new to Ruby to see how. Can someone help? Here's my first shot which doesn't work: compiler complains a block is expected after @parent.parent. class Node def initialize(parent, children=[]) @parent = parent @children = children @children.each { |child| child.parent(self) } end def parents @parent.parents unless @parent.nil? yield self end end --