Class: SmokeDetector::Providers::Airbrake
- Defined in:
- lib/smoke_detector/providers/airbrake.rb
Defined Under Namespace
Modules: ControllerMethods
Instance Attribute Summary
Attributes inherited from Provider
Instance Method Summary collapse
- #alert(exception, options = {}) ⇒ Object
-
#initialize(api_key, client_settings = {}, settings = {}) ⇒ Airbrake
constructor
A new instance of Airbrake.
- #message(message, options = {}) ⇒ Object
Methods inherited from Provider
Constructor Details
#initialize(api_key, client_settings = {}, settings = {}) ⇒ Airbrake
Returns a new instance of Airbrake.
4 5 6 7 8 9 10 |
# File 'lib/smoke_detector/providers/airbrake.rb', line 4 def initialize(api_key, client_settings = {}, settings = {}) super ::Airbrake.configure do |c| c.api_key = @client_settings[:api_key] apply_configuration_settings(c, settings) end end |
Instance Method Details
#alert(exception, options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/smoke_detector/providers/airbrake.rb', line 12 def alert(exception, = {}) .delete(:controller) (exception, ) end |
#message(message, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/smoke_detector/providers/airbrake.rb', line 17 def (, = {}) args = [] args << {parameters: [:data]} if [:data].present? ::Airbrake.notify(*args) end |