mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add then alias to yield_self.
`then' was added in CRuby 2.6.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user