Sha256: 9ae1e8f26a8da46f73ee12952b47de3885efb417172dc92bd73ea773914c68f2
Contents?: true
Size: 479 Bytes
Versions: 12
Compression:
Stored size: 479 Bytes
Contents
module Bogus module ProxiesMethodCalls def proxy(method_name) MethodCallProxy.new do |name, *args, &return_value| __send__(method_name, name, *args, &return_value) end end end class MethodCallProxy < BasicObject def initialize(&on_called) @on_called = on_called end def raise(*args) ::Kernel.raise(*args) end def method_missing(name, *args, &block) @on_called.call(name, *args, &block) end end end
Version data entries
12 entries across 12 versions & 1 rubygems