aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/string_questioneer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/string_questioneer.rb')
-rw-r--r--activesupport/lib/active_support/string_questioneer.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/string_questioneer.rb b/activesupport/lib/active_support/string_questioneer.rb
new file mode 100644
index 0000000000..7732f8b401
--- /dev/null
+++ b/activesupport/lib/active_support/string_questioneer.rb
@@ -0,0 +1,9 @@
+class StringQuestioneer < String
+ def method_missing(method_name, *arguments)
+ if method_name.to_s.ends_with?("?")
+ self == method_name.to_s[0..-2]
+ else
+ super
+ end
+ end
+end \ No newline at end of file