as_hash cleanup #377

merged 2 commits into from Apr 28, 2013


None yet
2 participants

ilmari commented Apr 28, 2013

These commits make the as_hash implementation and use more robust and correct, as well as more obvious to readers of the code.

ilmari added some commits Apr 28, 2013

@ilmari ilmari Use method modifer to override role-provided method
Calling the role's method directly means nothing else can modify it.
@ilmari ilmari Only call ->as_hash on actual objects when recursing
->can returns true for class names too, but actually calling ->as_hash
on a class consuming this role would throw an exception in

@schwern schwern added a commit that referenced this pull request Apr 28, 2013

@schwern schwern Merge pull request #377 from ilmari/as-hash-cleanup
as_hash cleanup

@schwern schwern merged commit 88633a0 into Test-More:Test-Builder1.5 Apr 28, 2013


schwern commented Apr 28, 2013

We like cleanups. :)

ilmari deleted the unknown repository branch May 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment