diff options
author | Aleksey Magusev <lexmag@gmail.com> | 2012-08-05 23:30:01 +0400 |
---|---|---|
committer | Aleksey Magusev <lexmag@gmail.com> | 2012-08-06 16:59:12 +0400 |
commit | a1beec1de001f822ee62e4b2d6450bcc2aafb56b (patch) | |
tree | 32a179ee0dc1fb07097a81a49eb6098cf6875a6a /activesupport/lib | |
parent | daf9f9ffa608b24c475403b9a0b3839ca373b2db (diff) | |
download | rails-a1beec1de001f822ee62e4b2d6450bcc2aafb56b.tar.gz rails-a1beec1de001f822ee62e4b2d6450bcc2aafb56b.tar.bz2 rails-a1beec1de001f822ee62e4b2d6450bcc2aafb56b.zip |
Add AS::StringInquirer#respond_to? method
Consistently with #method_missing
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/string_inquirer.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/string_inquirer.rb b/activesupport/lib/active_support/string_inquirer.rb index f3f3909a90..5f20bfa7bc 100644 --- a/activesupport/lib/active_support/string_inquirer.rb +++ b/activesupport/lib/active_support/string_inquirer.rb @@ -10,12 +10,18 @@ module ActiveSupport # Rails.env.production? # class StringInquirer < String - def method_missing(method_name, *arguments) - if method_name[-1, 1] == "?" - self == method_name[0..-2] - else - super + private + + def respond_to_missing?(method_name, include_private = false) + method_name[-1] == '?' + end + + def method_missing(method_name, *arguments) + if method_name[-1] == '?' + self == method_name[0..-2] + else + super + end end - end end end |