Module: WhoopsNotifier
- Defined in:
- lib/whoops_notifier.rb,
lib/whoops_notifier/report.rb,
lib/whoops_notifier/sender.rb,
lib/whoops_notifier/strategy.rb,
lib/whoops_notifier/investigator.rb
Defined Under Namespace
Classes: Investigator, Report, Sender, Strategy
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.strategies ⇒ Object
Returns the value of attribute strategies.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
13 14 15 |
# File 'lib/whoops_notifier.rb', line 13 def config @config end |
.strategies ⇒ Object
Returns the value of attribute strategies.
13 14 15 |
# File 'lib/whoops_notifier.rb', line 13 def strategies @strategies end |
Class Method Details
.notify(evidence) ⇒ Object .notify(strategy_name, evidence) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/whoops_notifier.rb', line 21 def notify(strategy_name, evidence = {}) if strategy_name.is_a? Hash notify("default::basic", strategy_name) else investigator = Investigator.new(strategies[strategy_name], evidence) investigator.investigate! send_report(investigator.report) unless investigator.ignore_report? end end |
.send_report(report) ⇒ Object
31 32 33 |
# File 'lib/whoops_notifier.rb', line 31 def send_report(report) Sender.new(WhoopsNotifier.config.to_hash).send_report(report.to_hash) end |