diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 04:37:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 04:37:32 +0000 |
commit | eedd9d7604b6acbabb5d21fe20a87420bc07864c (patch) | |
tree | 8eb300376beac857b15254f635cff38117afddee /activesupport/lib/active_support/core_ext/object | |
parent | a4f1262ac5e55b3b373b5519f252aa8462d576fd (diff) | |
download | rails-eedd9d7604b6acbabb5d21fe20a87420bc07864c.tar.gz rails-eedd9d7604b6acbabb5d21fe20a87420bc07864c.tar.bz2 rails-eedd9d7604b6acbabb5d21fe20a87420bc07864c.zip |
Updated Kernel#returning for the AP performance patch [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3991 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/misc.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb index 52c3773eea..ea8e3a1d6a 100644 --- a/activesupport/lib/active_support/core_ext/object/misc.rb +++ b/activesupport/lib/active_support/core_ext/object/misc.rb @@ -10,8 +10,17 @@ class Object #:nodoc: # # foo # => ['bar', 'baz'] # + # def foo + # returning [] do |values| + # values << 'bar' + # values << 'baz' + # end + # end + # + # foo # => ['bar', 'baz'] + # def returning(value) - yield + yield(value) value end |