Skip to content

Modernize respond_to implementations - #264

Merged
jnunemaker merged 1 commit into
jnunemaker:masterfrom
derekprior:dp-modern-respond-to
Jan 6, 2014
Merged

Modernize respond_to implementations#264
jnunemaker merged 1 commit into
jnunemaker:masterfrom
derekprior:dp-modern-respond-to

Conversation

@derekprior

Copy link
Copy Markdown
Contributor

Since at least Ruby 1.8.7, respond_to? has supported an optional
second parameter which causes private/protected methods to be included
in the check. This defaults to false.

As of Ruby 2, there's a warning logged if an implementation of
respond_to does not take a second parameter, see:
ruby/ruby@a106b31

This change updated the respond_to implementations to support the second
parameter and squelch this warning.

Since at least Ruby 1.8.7, `respond_to?` has supported an optional
second parameter which causes private/protected methods to be included
in the check. This defaults to false.

As of Ruby 2, there's a warning logged if an implementation of
`respond_to` does not take a second parameter, see:
ruby/ruby@a106b31

This change updated the respond_to implementations to support the second
parameter.
jnunemaker pushed a commit that referenced this pull request Jan 6, 2014
Modernize respond_to implementations
@jnunemaker
jnunemaker merged commit b48cc4a into jnunemaker:master Jan 6, 2014
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.

2 participants