aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-06 09:24:37 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-06 09:24:37 -0700
commitbf39026d567021f80f25affb8d2ddc4b3560def6 (patch)
treea8c2f2d06d8d4a086bb00abd96367ffa7705604c /activesupport/lib/active_support
parent3a91d44eff00476e399b3246871f4760817ecf9e (diff)
parenta1beec1de001f822ee62e4b2d6450bcc2aafb56b (diff)
downloadrails-bf39026d567021f80f25affb8d2ddc4b3560def6.tar.gz
rails-bf39026d567021f80f25affb8d2ddc4b3560def6.tar.bz2
rails-bf39026d567021f80f25affb8d2ddc4b3560def6.zip
Merge pull request #7272 from lexmag/string_inquirer
Add AS::StringInquirer#respond_to? method
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/string_inquirer.rb18
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