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

enhance respond_to? method #62

Merged
merged 2 commits into from Feb 12, 2013
Merged

enhance respond_to? method #62

merged 2 commits into from Feb 12, 2013

Conversation

dlupu
Copy link

@dlupu dlupu commented Nov 2, 2012

...::MethodWriter#respond_to? and Hashie::Extensions::MethodQuery#respond_to? so that it supports the optional include_private argument - needed to work properly with some other modules like ActiveModel::Validations

Dorian LUPU added 2 commits November 2, 2012 20:03
…ons::MethodWriter#respond_to? and Hashie::Extensions::MethodQuery#respond_to? so that it supports the optional include_private argument - needed to work properly with some other modules like ActiveModel::Validations
@jch
Copy link
Contributor

jch commented Dec 12, 2012

Could you link me to the docs where include_private is used? It makes sense that you want the method signature to be compatible, but I noticed you're not actually doing anything with the parameter. Is it safe to assume the value is false?

@dlupu
Copy link
Author

dlupu commented Dec 13, 2012

Hy @jch, thanks for answering.

Actually this is how the super of respond_to is declared (see http://ruby-doc.org/core-1.9.3/Object.html#method-i-respond_to-3F).

So when I tried to use the responds_to? with the include_privateset to true i got an “wrong number of arguments” ArgumentError. My pull request fixes this!

This issue is similar to #20 (same problem, same fix).

So please accept this pull request :)

@nashby
Copy link
Contributor

nashby commented Jan 7, 2013

@dlupu it would be great if you add some specs for that code :)

@jch
Copy link
Contributor

jch commented Feb 12, 2013

Sorry this took so long to get around to. I just got commit access to clean things up. Thanks again for the pull! 🍻

jch added a commit that referenced this pull request Feb 12, 2013
enhance respond_to? method
@jch jch merged commit 419446a into hashie:master Feb 12, 2013
@jch
Copy link
Contributor

jch commented Feb 12, 2013

Oops, looks like this does not work on ruby 1.8 https://travis-ci.org/intridea/hashie/builds/4736037. I'm going to revert the change, but feel free to open another pull if you find a better fix.

jch pushed a commit that referenced this pull request Feb 12, 2013
This reverts commit 419446a, reversing
changes made to fec979f.
jch pushed a commit that referenced this pull request Feb 12, 2013
jch added a commit that referenced this pull request Feb 12, 2013
Review pull #62: respond_to? 1.9
@jch
Copy link
Contributor

jch commented Feb 12, 2013

I've merged the change back in. It turns out the problem was from another commit. See #74

ohrite pushed a commit to ohrite/hashie that referenced this pull request Feb 12, 2013
This reverts commit 419446a, reversing
changes made to fec979f.
ohrite pushed a commit to ohrite/hashie that referenced this pull request Feb 12, 2013
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

3 participants