module NewRelic::Agent::Instrumentation::Rack::Prepend

Public Class Methods

prepended(builder_class) click to toggle source
# File lib/new_relic/agent/instrumentation/rack/prepend.rb, line 18
def self.prepended(builder_class)
  NewRelic::Agent::Instrumentation::RackBuilder.track_deferred_detection(builder_class)
end

Public Instance Methods

run(app = nil, *args, &block) click to toggle source
Calls superclass method
# File lib/new_relic/agent/instrumentation/rack/prepend.rb, line 26
def run(app = nil, *args, &block)
  app_or_block = app || block
  run_with_tracing(app_or_block) do |wrapped|
    # Rack::Builder#run for Rack v3+ supports a block, and does not
    # support args. Whether a block or an app is provided, that callable
    # object will be wrapped into a MiddlewareProxy instance. That
    # proxy instance must then be passed to super as the app argument.
    block ? super(wrapped, &nil) : super(wrapped, *args)
  end
end
to_app() click to toggle source
Calls superclass method
# File lib/new_relic/agent/instrumentation/rack/prepend.rb, line 22
def to_app
  with_deferred_dependency_detection { super }
end
use(middleware_class, *args, &blk) click to toggle source
Calls superclass method
# File lib/new_relic/agent/instrumentation/rack/prepend.rb, line 37
def use(middleware_class, *args, &blk)
  use_with_tracing(middleware_class) { |wrapped_class| super(wrapped_class, *args, &blk) }
end