class ExceptionNotifier::SquashNotifier::BaseNotifier

Public Class Methods

new(options) click to toggle source
# File lib/exception_notifier/squash_notifier/base.rb, line 39
def initialize(options)
  Squash::Ruby.configure default_options.merge(options)
  Squash::Ruby.configure disabled: !Squash::Ruby.configuration(:api_key)
end
whitelist_env_filter() click to toggle source
# File lib/exception_notifier/squash_notifier/base.rb, line 16
def self.whitelist_env_filter
  # Remove any entries from the 'env' var that are not in the 'whitelisted_env_var' list
  lambda do |env|
    env.select do |key, val|
      #NB: we want to close-over `self` so we can access the class var
      #NB:
      # - When `allowed` is a Regexp, === is like ((a =~ b) ? true : false)
      # - When `allowed` is a String, === is like (a == b.to_str)
      # - When `allowed` is a Symbol, === is (a == b)
      self.whitelisted_env_vars.any? {|allowed|  allowed === key }
    end
  end
end

Public Instance Methods

call(exception, data={}) click to toggle source
# File lib/exception_notifier/squash_notifier/base.rb, line 44
def call(exception, data={})
  raise NotImplementedError
end