class Airbrake::FilterChain
@since v1.0.0
@api private
@see Airbrake.add_filter
filters.
Represents the mechanism for filtering notices. Defines a few default
#
def add_filter(filter)
-
(void)
-
Parameters:
-
filter
(#call
) -- The filter object (proc, class, module, etc)
def add_filter(filter) @filters = (@filters << filter).sort_by do |f| f.respond_to?(:weight) ? f.weight : DEFAULT_WEIGHT end.reverse! end
def initialize
def initialize @filters = [] DEFAULT_FILTERS.each { |f| add_filter(f.new) } end
def refine(notice)
-
(void)
-
Parameters:
-
notice
(Airbrake::Notice
) -- The notice to be filtered
def refine(notice) @filters.each do |filter| break if notice.ignored? filter.call(notice) end end