From: Assaph Mehr Date: 2004-12-13T10:22:20+09:00 Subject: Re: Avoiding if requires type mutation -- evil.rb? Why make the distinction between leaf and node? A leaf is just a node without children. Why not simply have something like (code written to email, not checked): class Node attr_accessor :children def initialize children = [] end def leaf? children.size.zero? end end And use it as if node.leaf? # do leafy stuff else # do branchy stuff end