aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation/reporting.rb
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-12-20 11:50:47 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-12-21 10:40:15 +1000
commit1cacb08b213e9d0f92cf1fad89ff10141211bce8 (patch)
treed08e3c5110d1853a45ceef122a52966b7a525d79 /activesupport/lib/active_support/deprecation/reporting.rb
parent8373c735c7dc8adeffffbf85176676fecb6221fc (diff)
downloadrails-1cacb08b213e9d0f92cf1fad89ff10141211bce8.tar.gz
rails-1cacb08b213e9d0f92cf1fad89ff10141211bce8.tar.bz2
rails-1cacb08b213e9d0f92cf1fad89ff10141211bce8.zip
Improve documentation on ActiveSupport::Deprecation.
Diffstat (limited to 'activesupport/lib/active_support/deprecation/reporting.rb')
-rw-r--r--activesupport/lib/active_support/deprecation/reporting.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/deprecation/reporting.rb b/activesupport/lib/active_support/deprecation/reporting.rb
index 6a7b11c7e0..c7723d139b 100644
--- a/activesupport/lib/active_support/deprecation/reporting.rb
+++ b/activesupport/lib/active_support/deprecation/reporting.rb
@@ -2,7 +2,13 @@ module ActiveSupport
module Deprecation
class << self
attr_accessor :silenced
-
+
+ # Outputs a deprecation warning to the output configured by <tt>ActiveSupport::Deprecation.behavior</tt>
+ #
+ # Example:
+ #
+ # ActiveSupport::Deprecation.warn("something broke!")
+ # #=> "DEPRECATION WARNING: something broke! (called from your_code.rb:1)"
def warn(message = nil, callstack = caller)
return if silenced
deprecation_message(callstack, message).tap do |m|