class Airbrake::Config::Processor

@api private
@since v5.0.0
config values, default notifier filters and remote configuration changes.
Processor is a helper class, which is responsible for setting default

def self.process(config)

Returns:
  • (Airbrake::Config::Processor) -

Parameters:
  • config (Airbrake::Config) --
def self.process(config)
  new(config).process
end

def add_filters(notifier)

Returns:
  • (void) -

Parameters:
  • notifier (Airbrake::NoticeNotifier) --
def add_filters(notifier)
  return unless @config.root_directory
  [
    Airbrake::Filters::RootDirectoryFilter,
    Airbrake::Filters::GitRevisionFilter,
    Airbrake::Filters::GitRepositoryFilter,
    Airbrake::Filters::GitLastCheckoutFilter,
  ].each do |filter|
    next if notifier.has_filter?(filter)
    notifier.add_filter(filter.new(@config.root_directory))
  end
end

def initialize(config)

Parameters:
  • config (Airbrake::Config) --
def initialize(config)
  @config = config
  @blocklist_keys = @config.blocklist_keys
  @allowlist_keys = @config.allowlist_keys
  @project_id = @config.project_id
  @poll_callback = Airbrake::RemoteSettings::Callback.new(config)
end

def process_allowlist(notifier)

Returns:
  • (void) -

Parameters:
  • notifier (Airbrake::NoticeNotifier) --
def process_allowlist(notifier)
  return if @allowlist_keys.none?
  allowlist = Airbrake::Filters::KeysAllowlist.new(@allowlist_keys)
  notifier.add_filter(allowlist)
end

def process_blocklist(notifier)

Returns:
  • (void) -

Parameters:
  • notifier (Airbrake::NoticeNotifier) --
def process_blocklist(notifier)
  return if @blocklist_keys.none?
  blocklist = Airbrake::Filters::KeysBlocklist.new(@blocklist_keys)
  notifier.add_filter(blocklist)
end

def process_remote_configuration

Returns:
  • (Airbrake::RemoteSettings) -
def process_remote_configuration
  return unless @config.remote_config
  return unless @project_id
  # Never poll remote configuration in the test environment.
  return if @config.environment == 'test'
  # If the current environment is ignored, don't try to poll remote
  # configuration.
  return if @config.ignore_environments.include?(@config.environment)
  RemoteSettings.poll(@project_id, @config.remote_config_host) do |data|
    @poll_callback.call(data)
  end
end