Class: ExceptionNotifier::SquashNotifier::BaseNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::SquashNotifier::BaseNotifier
- Defined in:
- lib/exception_notifier/squash_notifier/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #call(exception, data = {}) ⇒ Object
-
#initialize(options) ⇒ BaseNotifier
constructor
A new instance of BaseNotifier.
Constructor Details
#initialize(options) ⇒ BaseNotifier
Returns a new instance of BaseNotifier.
39 40 41 42 |
# File 'lib/exception_notifier/squash_notifier/base.rb', line 39 def initialize() Squash::Ruby.configure .merge() Squash::Ruby.configure disabled: !Squash::Ruby.configuration(:api_key) end |
Class Method Details
.whitelist_env_filter ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 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 |
Instance Method Details
#call(exception, data = {}) ⇒ Object
44 45 46 |
# File 'lib/exception_notifier/squash_notifier/base.rb', line 44 def call(exception, data={}) raise NotImplementedError end |