-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Labels
Description
I think RubyTree should have convenience methods to convert built-in hierarchical structures to trees. I propose Tree.create_from_hash(hash) as a class method. After all, you have JSON input/output, why not built-in data structures. I'd like for it to work with arbitrary nested hashes.
A few questions:
Is it OK as a class method? I think it makes sense.
Naming: do you prefer Tree.create_from_hash() or Tree.from_hash()?
Would you want it directly in the Tree class or split out into utility class like JSON is?