Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mixin for Hash conversions #30

Merged
merged 6 commits into from
Oct 25, 2014
Merged

Add mixin for Hash conversions #30

merged 6 commits into from
Oct 25, 2014

Conversation

jhamon
Copy link
Contributor

@jhamon jhamon commented Oct 14, 2014

I saw that Issue #13 seems to have stalled for quite a long time. I had some time today to put this together and would like your feedback on it, @evolve75

Everything's organized into a new mixin, Tree::Utils::HashConverter. This PR includes:

Class methods

  • from_hash, builds a Tree::TreeNode tree from a Ruby hash

Instance methods

  • add_from_hash (somewhat similar to add or <<, but for use when information for one or more child nodes is present in a Hash object).
  • to_h hash export function.

You'll see I also wrote a good number of assertions to verify functionality.

@evolve75 evolve75 added this to the 0.9.5 milestone Oct 25, 2014
@evolve75 evolve75 self-assigned this Oct 25, 2014
evolve75 added a commit that referenced this pull request Oct 25, 2014
Add mixin for Hash conversions. Thanks to @jhamon.
@evolve75 evolve75 merged commit cd971eb into evolve75:master Oct 25, 2014
@evolve75
Copy link
Owner

@jhamon,

Thanks! This is great, and thanks again for the clear and detailed documentation!. I have merged in your changes, and will upload 0.9.5pre very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants