Class: Telebugs::Reporter
- Inherits:
-
Object
- Object
- Telebugs::Reporter
- Defined in:
- lib/telebugs/reporter.rb
Overview
Reporter is reponsible for sending reports to Telebugs.
Class Attribute Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
- #report(error) ⇒ Object
Constructor Details
#initialize ⇒ Reporter
14 15 16 17 |
# File 'lib/telebugs/reporter.rb', line 14 def initialize @sender = Sender.new @middleware = Config.instance.middleware end |
Class Attribute Details
.instance ⇒ Object
9 10 11 |
# File 'lib/telebugs/reporter.rb', line 9 def instance @instance ||= new end |
Instance Method Details
#report(error) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/telebugs/reporter.rb', line 19 def report(error) Telebugs::Promise.new(error) do report = Report.new(error) @middleware.call(report) next if report.ignored @sender.send(report) end end |