Class: WhoopsNotifier::Investigator
- Inherits:
-
Object
- Object
- WhoopsNotifier::Investigator
- Defined in:
- lib/whoops_notifier/investigator.rb
Instance Attribute Summary collapse
-
#evidence ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored.
-
#ignore_report ⇒ Object
(also: #ignore_report?)
get data from evidence using a strategy to create a report and decide whether it should be ignored.
-
#report ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored.
-
#strategy ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored.
Instance Method Summary collapse
- #create_report ⇒ Object
-
#initialize(strategy, evidence) ⇒ Investigator
constructor
A new instance of Investigator.
- #investigate! ⇒ Object
Constructor Details
#initialize(strategy, evidence) ⇒ Investigator
Returns a new instance of Investigator.
7 8 9 10 11 12 13 |
# File 'lib/whoops_notifier/investigator.rb', line 7 def initialize(strategy, evidence) raise ArgumentError, "strategy can not be nil" if strategy.nil? raise ArgumentError, "strategy must respond to 'call'" unless strategy.respond_to?(:call) self.strategy = strategy self.evidence = evidence self.report = Report.new end |
Instance Attribute Details
#evidence ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored
4 5 6 |
# File 'lib/whoops_notifier/investigator.rb', line 4 def evidence @evidence end |
#ignore_report ⇒ Object Also known as: ignore_report?
get data from evidence using a strategy to create a report and decide whether it should be ignored
4 5 6 |
# File 'lib/whoops_notifier/investigator.rb', line 4 def ignore_report @ignore_report end |
#report ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored
4 5 6 |
# File 'lib/whoops_notifier/investigator.rb', line 4 def report @report end |
#strategy ⇒ Object
get data from evidence using a strategy to create a report and decide whether it should be ignored
4 5 6 |
# File 'lib/whoops_notifier/investigator.rb', line 4 def strategy @strategy end |
Instance Method Details
#create_report ⇒ Object
19 20 21 |
# File 'lib/whoops_notifier/investigator.rb', line 19 def create_report strategy.call(self) end |
#investigate! ⇒ Object
15 16 17 |
# File 'lib/whoops_notifier/investigator.rb', line 15 def investigate! create_report end |