mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Added documentation for ActiveSupport::StringInquirer class
This commit is contained in:
committed by
Pratik Naik
parent
f6124c2b09
commit
e5fadfea8a
@@ -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 <tt>Rails.env</tt> 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?("?")
|
||||
|
||||
Reference in New Issue
Block a user