Module: NewRelic::Security::Instrumentation::Grape::Router::Chain

Defined in:
lib/newrelic_security/instrumentation-security/grape/chain.rb

Class Method Summary collapse

Class Method Details

.instrument!Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/newrelic_security/instrumentation-security/grape/chain.rb', line 32

def self.instrument!
  ::Grape::Router.class_eval do
    include NewRelic::Security::Instrumentation::Grape::Router

    alias_method :prepare_env_from_route_without_security, :prepare_env_from_route

    def prepare_env_from_route(env, route)
      prepare_env_from_route_on_enter(route) { prepare_env_from_route_without_security(env, route) }
    end
  end
end