blob: 25a4d4ed439333e695c221dee47c57e9aeff9f4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
module Kernel
# call-seq:
# obj.yield_self {|_obj|...} -> an_object
#
# Yields <i>obj</i> and returns the result.
#
# 'my string'.yield_self {|s|s.upcase} #=> "MY STRING"
#
def yield_self(&block)
return to_enum :yield_self unless block
block.call(self)
end
end
|