From 8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 3 Jun 2008 17:44:56 -0500 Subject: Wrapped Rails.env in StringQuestioneer so you can do Rails.env.development? [DHH] --- activesupport/lib/active_support/string_questioneer.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 activesupport/lib/active_support/string_questioneer.rb (limited to 'activesupport/lib/active_support/string_questioneer.rb') 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 -- cgit v1.2.3