Class: Airbrake::Rack::RouteFilter
- Inherits:
-
Object
- Object
- Airbrake::Rack::RouteFilter
- Defined in:
- lib/airbrake/rack/route_filter.rb
Overview
Adds route slugs to context/route.
Instance Attribute Summary collapse
- #weight ⇒ Object readonly
Instance Method Summary collapse
- #call(notice) ⇒ Object
-
#initialize ⇒ RouteFilter
constructor
A new instance of RouteFilter.
Constructor Details
#initialize ⇒ RouteFilter
Returns a new instance of RouteFilter.
12 13 14 |
# File 'lib/airbrake/rack/route_filter.rb', line 12 def initialize @weight = 100 end |
Instance Attribute Details
#weight ⇒ Object (readonly)
10 11 12 |
# File 'lib/airbrake/rack/route_filter.rb', line 10 def weight @weight end |
Instance Method Details
#call(notice) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/airbrake/rack/route_filter.rb', line 16 def call(notice) return unless (request = notice.stash[:rack_request]) notice[:context][:route] = if action_dispatch_request?(request) rails_route(request) elsif sinatra_request?(request) sinatra_route(request) end end |