From 9495ec9191e035a096cd4a62c9275ae8d08da96f Mon Sep 17 00:00:00 2001 From: Nikita Shilnikov Date: Tue, 21 Jan 2025 12:30:51 +0100 Subject: [PATCH] Add missing block parameter A block is part of the Delegator's contract. Ruby 3.4 issues a warning if a block is passed but unused. This commit fixes the warning by adding a block to the argument list. --- lib/weakref.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/weakref.rb b/lib/weakref.rb index a8da39a..f0a7e7b 100644 --- a/lib/weakref.rb +++ b/lib/weakref.rb @@ -41,7 +41,7 @@ def initialize(orig) super end - def __getobj__ # :nodoc: + def __getobj__(&_block) # :nodoc: @@__map[self] or defined?(@delegate_sd_obj) ? @delegate_sd_obj : Kernel::raise(RefError, "Invalid Reference - probably recycled", Kernel::caller(2)) end