Family tree exercise in Ruby