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

Implemented #respond_to? #99

Closed
wants to merge 4 commits into from
Closed

Conversation

thomasbrus
Copy link
Contributor

This fixes #92 and #55

@guncha
Copy link

guncha commented Dec 11, 2013

I think the correct way is to override respond_to_missing? since some of the Kernel methods use it rather than respond_to?. Namely #method.

@thomasbrus
Copy link
Contributor Author

You're right. Didnt know about respond_to_missing :)

@@ -102,6 +102,16 @@ def each(&blk)
@values.each(&blk)
end

if RUBY_VERSION < '1.9.2'
def respond_to?(symbol)
@values.has_key(symbol) || super
Copy link
Contributor

Choose a reason for hiding this comment

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

👀 has_key?

@andrewpthorp
Copy link
Contributor

Sorry about the delay here!

Left a few notes. Would you mind moving respond_to_missing? under method_missing so the intent is a little clearer. If you would move respond_to? (and the conditional) under that, that would be great!

@andrewpthorp
Copy link
Contributor

On second thought, I went ahead and did it for you to finish it out! I saved your commits, so you will see them on the master branch. Thanks for the submission!

If you have any questions, feel free to send an email to support@stripe.com.

@thomasbrus
Copy link
Contributor Author

Cool, thanks;)

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.

ActiveSupport's Object#try doesn't work for Plan#id
3 participants