Ruby implementation of a binary tree