Sha256: 3855fb5569d76b732ce714e84ae9db5b2ca9f75003bef115bc50ae8a95ebfc6b
Contents?: true
Size: 634 Bytes
Versions: 16
Compression:
Stored size: 634 Bytes
Contents
# frozen_string_literal: true module InstrumentAllTheThings Context = Struct.new(:method_name, :instance, :tags, keyword_init: true) do def stats_name(klass_or_instance) @stats_name ||= [ class_name(klass_or_instance), "#{instance ? 'instance' : 'class'}_methods", method_name, ].join('.') end def trace_name(klass_or_instance) @trace_name ||= "#{class_name(klass_or_instance)}#{instance ? '.' : '#'}#{method_name}" end private def class_name(klass_or_instance) klass_or_instance.is_a?(Class) ? klass_or_instance.to_s : klass_or_instance end end end
Version data entries
16 entries across 16 versions & 1 rubygems