Class: Deadfire::ErrorReporter
- Inherits:
-
Object
- Object
- Deadfire::ErrorReporter
- Defined in:
- lib/deadfire/error_reporter.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #error(line, message) ⇒ Object
- #errors? ⇒ Boolean
-
#initialize ⇒ ErrorReporter
constructor
A new instance of ErrorReporter.
Constructor Details
#initialize ⇒ ErrorReporter
Returns a new instance of ErrorReporter.
7 8 9 |
# File 'lib/deadfire/error_reporter.rb', line 7 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/deadfire/error_reporter.rb', line 5 def errors @errors end |
Instance Method Details
#error(line, message) ⇒ Object
11 12 13 14 15 |
# File 'lib/deadfire/error_reporter.rb', line 11 def error(line, ) error = Error.new(line, ) Deadfire.configuration.logger.error(error.to_s) unless Deadfire.configuration.supressed @errors << error end |
#errors? ⇒ Boolean
17 18 19 |
# File 'lib/deadfire/error_reporter.rb', line 17 def errors? @errors.any? end |