Class: Newshound::Exceptions::Base
- Inherits:
-
Object
- Object
- Newshound::Exceptions::Base
- Defined in:
- lib/newshound/exceptions/base.rb
Overview
Base class for exception source adapters Each adapter is responsible for:
-
Fetching recent exceptions from its specific exception tracking system
-
Formatting exception data for reports and banners
Subclasses must implement:
-
#recent(time_range:, limit:) - Returns a collection of exception records
-
#format_for_report(exception) - Formats a single exception for Slack/report display
-
#format_for_banner(exception) - Formats a single exception for banner UI
Direct Known Subclasses
Instance Method Summary collapse
-
#format_for_banner(exception) ⇒ Hash
Formats an exception for banner UI display.
-
#format_for_report(exception, number) ⇒ String
Formats an exception for report/Slack display.
-
#recent(time_range:, limit:) ⇒ Array
Fetches recent exceptions from the exception tracking system.
Instance Method Details
#format_for_banner(exception) ⇒ Hash
Formats an exception for banner UI display
35 36 37 |
# File 'lib/newshound/exceptions/base.rb', line 35 def (exception) raise NotImplementedError, "#{self.class} must implement #format_for_banner" end |
#format_for_report(exception, number) ⇒ String
Formats an exception for report/Slack display
27 28 29 |
# File 'lib/newshound/exceptions/base.rb', line 27 def format_for_report(exception, number) raise NotImplementedError, "#{self.class} must implement #format_for_report" end |
#recent(time_range:, limit:) ⇒ Array
Fetches recent exceptions from the exception tracking system
18 19 20 |
# File 'lib/newshound/exceptions/base.rb', line 18 def recent(time_range:, limit:) raise NotImplementedError, "#{self.class} must implement #recent" end |