aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 23:12:05 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-20 23:12:05 +0000
commitd578196f9a5b583c167d60d0f10d7684f41aa318 (patch)
tree57601f77093382d6fe43718d13c320add23e46f5 /activesupport/lib
parent409d56abda45ee380d6a903cbf835e7a770061d8 (diff)
downloadrails-d578196f9a5b583c167d60d0f10d7684f41aa318.tar.gz
rails-d578196f9a5b583c167d60d0f10d7684f41aa318.tar.bz2
rails-d578196f9a5b583c167d60d0f10d7684f41aa318.zip
Added pagination support through both a controller and helper add-on #817 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@949 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/kernel.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/kernel.rb b/activesupport/lib/active_support/core_ext/kernel.rb
new file mode 100644
index 0000000000..fe6f725bc0
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/kernel.rb
@@ -0,0 +1,17 @@
+module Kernel
+ # A Ruby-ized realization of the K combinator, courtesy of Mikael Brockman.
+ #
+ # def foo
+ # returning values = [] do
+ # values << 'bar'
+ # values << 'baz'
+ # end
+ # end
+ #
+ # foo # => ['bar', 'baz']
+ #
+ def returning(value) #:nodoc:
+ yield
+ value
+ end
+end