From 5b0f8390545d49d4c8a83f1992858a35566815d2 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 25 Jul 2010 13:47:23 -0300 Subject: [PATCH] Deprecates Object#returning in favor of Object#tap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activesupport/lib/active_support/core_ext/object/misc.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb index 4acdfa3d6c..40611a67e1 100644 --- a/activesupport/lib/active_support/core_ext/object/misc.rb +++ b/activesupport/lib/active_support/core_ext/object/misc.rb @@ -1,3 +1,5 @@ +require 'active_support/deprecation' + class Object # Returns +value+ after yielding +value+ to the block. This simplifies the # process of constructing an object, performing work on the object, and then @@ -36,6 +38,7 @@ class Object # # foo # => ['bar', 'baz'] def returning(value) + ActiveSupport::Deprecation.warn('Object#returning has been deprecated in favor of Object#tap.', caller) yield(value) value end -- GitLab