Permalink
Browse files

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
  • Loading branch information...
dhh committed Mar 20, 2006
1 parent a4f1262 commit eedd9d7604b6acbabb5d21fe20a87420bc07864c
@@ -861,7 +861,7 @@ def reset_session #:doc:
def self.view_class
@view_class ||=
# create a new class based on the default template class and include helper methods
- returning view_class = Class.new(ActionView::Base) do
+ returning Class.new(ActionView::Base) do |view_class|
view_class.send(:include, master_helper_module)
end
end
@@ -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

0 comments on commit eedd9d7

Please sign in to comment.