blob: fe6f725bc09a3d53f8ad3dccbb0992f0ffe4a8ef (
plain) (
tree)
|
|
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
|