module ElasticAPM::Spies

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

@api private

Public Class Methods

hook_into(name) click to toggle source
# File lib/elastic_apm/spies.rb, line 48
def self.hook_into(name)
  return unless (registration = require_hooks[name])
  return unless safe_defined?(registration.const_name)

  installed[registration.const_name] = registration
  registration.install

  registration.require_paths.each do |path|
    require_hooks.delete path
  end
end
installed() click to toggle source
# File lib/elastic_apm/spies.rb, line 27
def self.installed
  @installed ||= {}
end
register(*args) click to toggle source
# File lib/elastic_apm/spies.rb, line 31
def self.register(*args)
  registration = Registration.new(*args)

  if safe_defined?(registration.const_name)
    registration.install
    installed[registration.const_name] = registration
  else
    register_require_hook registration
  end
end
register_require_hook(registration) click to toggle source
# File lib/elastic_apm/spies.rb, line 42
def self.register_require_hook(registration)
  registration.require_paths.each do |path|
    require_hooks[path] = registration
  end
end
require_hooks() click to toggle source
# File lib/elastic_apm/spies.rb, line 23
def self.require_hooks
  @require_hooks ||= {}
end
safe_defined?(const_name) click to toggle source
# File lib/elastic_apm/spies.rb, line 60
def self.safe_defined?(const_name)
  Util::Inflector.safe_constantize(const_name)
end