Skip to content
Browse files

Deprecates Object#returning in favor of Object#tap

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent a5d8c95 commit 5b0f8390545d49d4c8a83f1992858a35566815d2 @spastorino spastorino committed with josevalim Jul 25, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 activesupport/lib/active_support/core_ext/object/misc.rb
View
3 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

0 comments on commit 5b0f839

Please sign in to comment.
Something went wrong with that request. Please try again.