Sha256: b6749a0454f553d0831b7cfbd578013a5f730fe41ef3da3a1e008349828d07aa

Contents?: true

Size: 797 Bytes

Versions: 10

Compression:

Stored size: 797 Bytes

Contents

# typed: ignore

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.com/terms.html

require 'sqreen/ecosystem/module_api'

module Sqreen
  module Ecosystem
    module ModuleApi
      module Instrumentation
        def self.included(mod)
          mod.send :include, ModuleApi unless mod.ancestors.include?(ModuleApi)
        end

        private

        # Just forwards the call to the instrumentation service
        # @param [String] method
        # @param [Hash{Symbol=>Proc}] advice keys are one of: :before, :after,
        #                             :raised,
        def instrument(method, advice)
          DispatchTable.instrument.call(self.class.module_name, method, advice)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sqreen-1.25.1 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.25.0 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.24.3 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.24.2 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.24.1 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.24.0 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.23.2 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.23.1 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.23.0 lib/sqreen/ecosystem/module_api/instrumentation.rb
sqreen-1.22.1 lib/sqreen/ecosystem/module_api/instrumentation.rb