Class: Airbrake::Filters::DependencyFilter Private
- Inherits:
-
Object
- Object
- Airbrake::Filters::DependencyFilter
- Defined in:
- lib/airbrake-ruby/filters/dependency_filter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Attaches loaded dependencies to the notice object.
Instance Method Summary collapse
-
#call(notice) ⇒ void
private
This is a mandatory method required by any filter integrated with FilterChain.
-
#initialize ⇒ DependencyFilter
constructor
private
A new instance of DependencyFilter.
Constructor Details
#initialize ⇒ DependencyFilter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DependencyFilter.
8 9 10 |
# File 'lib/airbrake-ruby/filters/dependency_filter.rb', line 8 def initialize @weight = 117 end |
Instance Method Details
#call(notice) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
This is a mandatory method required by any filter integrated with FilterChain.
13 14 15 16 17 18 19 20 21 |
# File 'lib/airbrake-ruby/filters/dependency_filter.rb', line 13 def call(notice) deps = {} Gem.loaded_specs.map.with_object(deps) do |(name, spec), h| h[name] = "#{spec.version}#{git_version(spec)}" end notice[:context][:versions] = {} unless notice[:context].key?(:versions) notice[:context][:versions][:dependencies] = deps end |