lib/elastic_apm/span_helpers.rb in elastic-apm-4.5.1 vs lib/elastic_apm/span_helpers.rb in elastic-apm-4.6.0
- old
+ new
@@ -35,18 +35,18 @@
def __span_method_on(klass, method, name = nil, type = nil)
name ||= method.to_s
type ||= Span::DEFAULT_TYPE
klass.prepend(Module.new do
- define_method(method) do |*args, &block|
+ ruby2_keywords(define_method(method) do |*args, &block|
unless ElasticAPM.current_transaction
return super(*args, &block)
end
ElasticAPM.with_span name.to_s, type.to_s do
super(*args, &block)
end
- end
+ end)
end)
end
end
def self.included(kls)