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

Store original method #16

Merged
merged 7 commits into from
Jul 3, 2013
Merged

Store original method #16

merged 7 commits into from
Jul 3, 2013

Conversation

mbj
Copy link
Collaborator

@mbj mbj commented Jul 2, 2013

This PR introduces Class#original_instance_method(name) as discused in: http://irclog.whitequark.org/rom-rb/2013-07-02#4267764;

mbj added 3 commits June 29, 2013 00:17
The public interface of adamantium infected classes now allows to
receive the original unbound method instance via
Class#original_instance_method(method_name)
# @api private
#
def memoized_methods
@memoized_methods ||= {}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define this using Hash.new with a proc that throws the exception on an unknown name. I generally prefer (now) to define that kind of thing at the Hash level when it is the same all the time than duplicating it using #fetch.

I will update the original memory Hash instance to behave like this too.

dkubb added a commit that referenced this pull request Jul 3, 2013
@dkubb dkubb merged commit ca60bbb into dkubb:master Jul 3, 2013
@dkubb
Copy link
Owner

dkubb commented Jul 3, 2013

@mbj thanks for this, merged!

@mbj mbj deleted the store-original-method branch July 3, 2013 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants