intridea/hashie — pull request #195 by michaelherold (2014-07-22 04:51:11+00:00)
Title: Fix #178 and #180 by injecting in place

I thought I'd give this a try!

This was simpler than I thought it was going to be. The request was to make it so the same object is returned after a conversion. Thus, in `#convert_value` the calls to `#dup` for the values in an Array were violating the expectation, as was the call to `#inject` for a hash lacking indifference, since it `#dup`s the hash instead of injecting in place

The only way that I know to do this is not to dup the objects. This has a potential downside though, since `#convert_value` will now modify those objects in place; if the object is referenced elsewhere in the program, this could lead to unexpected behavior.

Is there another way to do this? I'm open to suggestions if someone knows a better way!