summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-05-15 11:40:12 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-05-23 08:30:50 +0900
commitc8fb7453fc50887c23e1fa567dd785003987ec48 (patch)
treec20102d70779dea52051bebaa5ca65e0a2e9111c /mrbgems
parenta7c8575fe3bd1e66c74bca8815503f6d95eebb8a (diff)
downloadmruby-c8fb7453fc50887c23e1fa567dd785003987ec48.tar.gz
mruby-c8fb7453fc50887c23e1fa567dd785003987ec48.zip
Add `then` alias to `yield_self`.
`then' was added in CRuby 2.6.
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-kernel-ext/mrblib/kernel.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/mrbgems/mruby-kernel-ext/mrblib/kernel.rb b/mrbgems/mruby-kernel-ext/mrblib/kernel.rb
index 25a4d4ed4..bf739ed1a 100644
--- a/mrbgems/mruby-kernel-ext/mrblib/kernel.rb
+++ b/mrbgems/mruby-kernel-ext/mrblib/kernel.rb
@@ -1,6 +1,7 @@
module Kernel
# call-seq:
# obj.yield_self {|_obj|...} -> an_object
+ # obj.then {|_obj|...} -> an_object
#
# Yields <i>obj</i> and returns the result.
#
@@ -10,4 +11,5 @@ module Kernel
return to_enum :yield_self unless block
block.call(self)
end
+ alias then yield_self
end