From 5eb7cbf4e3f96444ba6189ecf2d349f35747d5ce Mon Sep 17 00:00:00 2001 From: Nithin Bekal Date: Tue, 1 Oct 2024 22:43:59 -0400 Subject: [PATCH] [DOC] Alias Kernel#yield_self to #then --- kernel.rb | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/kernel.rb b/kernel.rb index 541d0cfd9d..b3da289053 100644 --- a/kernel.rb +++ b/kernel.rb @@ -135,21 +135,7 @@ module Kernel yield(self) end - # - # call-seq: - # obj.yield_self {|x| block } -> an_object - # - # Yields self to the block and returns the result of the block. - # - # "my string".yield_self {|s| s.upcase } #=> "MY STRING" - # - def yield_self - Primitive.attr! :inline_block - unless defined?(yield) - return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 0, 0, rb_obj_size)' - end - yield(self) - end + alias yield_self then module_function