Class: Cyclid::Linter::StatusLogger
- Inherits:
-
Object
- Object
- Cyclid::Linter::StatusLogger
- Defined in:
- lib/cyclid/linter.rb
Overview
A simple helper to track Warnings & Errors from the Verifier
Defined Under Namespace
Modules: MessageTypes
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #error(message) ⇒ Object
-
#initialize ⇒ StatusLogger
constructor
A new instance of StatusLogger.
- #warning(message) ⇒ Object
Constructor Details
#initialize ⇒ StatusLogger
Returns a new instance of StatusLogger.
32 33 34 35 36 |
# File 'lib/cyclid/linter.rb', line 32 def initialize = [] @warnings = 0 @errors = 0 end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
25 26 27 |
# File 'lib/cyclid/linter.rb', line 25 def errors @errors end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
25 26 27 |
# File 'lib/cyclid/linter.rb', line 25 def end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
25 26 27 |
# File 'lib/cyclid/linter.rb', line 25 def warnings @warnings end |
Instance Method Details
#error(message) ⇒ Object
43 44 45 46 |
# File 'lib/cyclid/linter.rb', line 43 def error() @errors += 1 << { type: MessageTypes::ERROR, text: } end |
#warning(message) ⇒ Object
38 39 40 41 |
# File 'lib/cyclid/linter.rb', line 38 def warning() @warnings += 1 << { type: MessageTypes::WARNING, text: } end |