Sha256: d86da442fa749f8041c0d84349a6b62ecc5c75c5abf748198d04eeb723f4d0a7
Contents?: true
Size: 1.04 KB
Versions: 18
Compression:
Stored size: 1.04 KB
Contents
module Skylight module Util module InstrumenterMethod def instrumenter_method(name, block: false) if block module_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{name}(*args) # def mute(*args) unless instrumenter # unless instrumenter return yield if block_given? # return yield if block_given? return # return end # end # instrumenter.#{name}(*args) { yield } # instrumenter.mute(*args) { yield } end # end RUBY else module_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{name}(*args) # def config(*args) instrumenter&.#{name}(*args) # instrumenter&.config(*args) end # end RUBY end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems