From e5fadfea8a808b145489122d2c59a92bcbb341be Mon Sep 17 00:00:00 2001 From: Pat Nakajima Date: Wed, 30 Jul 2008 16:37:57 -0400 Subject: Added documentation for ActiveSupport::StringInquirer class --- activesupport/lib/active_support/string_inquirer.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/string_inquirer.rb b/activesupport/lib/active_support/string_inquirer.rb index 65545748df..cd722a3cfb 100644 --- a/activesupport/lib/active_support/string_inquirer.rb +++ b/activesupport/lib/active_support/string_inquirer.rb @@ -1,4 +1,14 @@ module ActiveSupport + # Wrapping a string in this class gives you a prettier way to test + # for equality. The value returned by Rails.env is wrapped + # in a StringInquirer object so instead of calling this: + # + # Rails.env == "production" + # + # you can call this: + # + # Rails.env.production? + # class StringInquirer < String def method_missing(method_name, *arguments) if method_name.to_s.ends_with?("?") -- cgit v1.2.3