Skip to content

Commit

Permalink
Fix BasicObject cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Aug 13, 2024
1 parent 7dfae62 commit 8327175
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/delayed/message_sending.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module Delayed
class DelayProxy < BasicObject
undef_method :==
undef_method :equal?
# What additional methods exist on BasicObject has changed over time
(::BasicObject.instance_methods - [:__id__, :__send__, :instance_eval, :instance_exec]).each do |method|
undef_method method
end

# Let DelayProxy raise exceptions.
define_method(:raise, ::Object.instance_method(:raise))
def raise(*args)
::Object.send(:raise, *args)
end

def initialize(payload_class, target, options)
@payload_class = payload_class
Expand Down

0 comments on commit 8327175

Please sign in to comment.