🚴 Ruby exercise for Sleep Number interviewees
Convert an array of Person objects into a tree of PersonTreeNode objects.
- Clone the repository
- Open
person.rb,person_tree_node.rb, andanswer.rbin your favorite editor - Add your code to the
generate_treemethod inanswer.rb
- The exercise uses two Ruby classes:
PersonandPersonTreeNode - The
generate_treemethod receives an array ofPersonobjects and should return the rootPersonTreeNode(CEO) - Each
PersonTreeNode'sdirect_reportsarray should contain aPersonTreeNodefor each direct report of that person - The app will use your
generate_treemethod to evaluate the test - From the command line, execute 'run test.rb' until the tests pass