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
Fixes #119: Allow overwriting methods in Mash #198
Fixes #119: Allow overwriting methods in Mash #198
Conversation
When a method is overwritten, you can still access it by passing `#hash_<method_name>`. For an example, see the included documentation. This is a breaking change since it changes the behavior of overridden methods, so it should require a version bump for Hashie to adhere to the [Semantic Versioning][semver] policy. [semver]: http://semver.org
This is a quick reply, haven't dig into the code, but i don't really get the point of this PR. Could you explain why method access is not enough? thx! :) |
Bump @michaelherold |
I'll see if I can get to this this week. Got a lot going on at work. Here's what I think needs done from the discussion in the related thread:
Does that sound about right? /cc @gregory since he was a big part of the discussion around this PR |
Sounds right to me. |
This is part 1 of 3 of the to-do list determined in hashie#198.
This is part 1 of 3 of the to-do list determined in hashie#198.
This is part 2 of 3 of the to-do list determined in hashie#198.
This is part 2 of 3 of the to-do list determined in hashie#198.
This is part 3 of 3 of the to-do list determined in hashie#198.
This is part 1 of 3 of the to-do list determined in hashie#198.
This is part 2 of 3 of the to-do list determined in hashie#198.
This is part 2 of 3 of the to-do list determined in #198.
This is part 3 of 3 of the to-do list determined in #198.
Merged all those, great work! What do we want to do with this PR? Close? |
Great! 👍 All of the relevant stuff is split up between those other PRs, so I'm going to go ahead and close this one. |
Changes to Mash
When a method is overwritten, you can still access it by passing
#hash_<method_name>
. For an example, see the included documentation.This is a breaking change since it changes the behavior of overridden methods, so it should require a version bump for Hashie to adhere to the Semantic Versioning policy.
Smash
Added as a safe alternative to Mash. A Smash prevents the user from overwriting a method with an attribute. This is more along the lines of the original Mash, except that it raises an
ArgumentError
if the user tries to overwrite a method with an attribute.