From 3dc383d7639a2d134a3daeeef34551533c8376b2 Mon Sep 17 00:00:00 2001 From: Pat Nakajima Date: Wed, 30 Jul 2008 16:37:57 -0400 Subject: [PATCH] added documentation for ActiveSupport::StringInquirer class --- .../lib/active_support/string_inquirer.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/activesupport/lib/active_support/string_inquirer.rb b/activesupport/lib/active_support/string_inquirer.rb index 6554574..cd722a3 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?("?") -- 1.5.4.2