lib/syncem.rb in syncem-0.1.1 vs lib/syncem.rb in syncem-0.1.2

- old
+ new

@@ -30,18 +30,20 @@ # # Author:: Yegor Bugayenko (yegor256@gmail.com) # Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko # License:: MIT class SyncEm + undef_method :send + def initialize(origin) @origin = origin @mutex = Mutex.new end def method_missing(*args) @mutex.synchronize do if @origin.respond_to?(args[0]) - @origin.send(*args) do |*a| + @origin.__send__(*args) do |*a| yield(*a) if block_given? end else super end