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