From: "matt.smillie@..." Date: 2006-02-19T00:18:29+09:00 Subject: Re: How to translate a C tree structure to ruby tree objects The children of a node go in @children. They're probably other nodes. The transformation matrix and function would likely be data members holding, respectively, a matrix and a proc object. An alternate approach for the drawing function would be to make an instance method that receives a block (where the block would contain the drawing function). So, potentially something like this: class Node attr_accessor :children, :parent, :transform def initialize(parent = nil, transform = some_sort_of _matrix_object) @children = [] @transform = transform if parent then parent.add_child(self) end end def add_child(node) @children.push(node) node.parent = self end def draw(&block) yield end end