Class: CI::Syntax::Tool::Result::FileResult
- Inherits:
-
CI::Syntax::Tool::Result
- Object
- CI::Syntax::Tool::Result
- CI::Syntax::Tool::Result::FileResult
- Defined in:
- lib/ci-syntax-tool/result.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #add_issue(opts) ⇒ Object
- #error_count ⇒ Object
- #errors ⇒ Object
-
#initialize(path) ⇒ FileResult
constructor
A new instance of FileResult.
- #warning_count ⇒ Object
- #warnings ⇒ Object
Constructor Details
#initialize(path) ⇒ FileResult
Returns a new instance of FileResult.
103 104 105 106 107 |
# File 'lib/ci-syntax-tool/result.rb', line 103 def initialize(path) @path = path @whole_file_processed = false @issues = [] end |
Instance Attribute Details
#issues ⇒ Object (readonly)
Returns the value of attribute issues.
101 102 103 |
# File 'lib/ci-syntax-tool/result.rb', line 101 def issues @issues end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
100 101 102 |
# File 'lib/ci-syntax-tool/result.rb', line 100 def path @path end |
Instance Method Details
#add_issue(opts) ⇒ Object
109 110 111 |
# File 'lib/ci-syntax-tool/result.rb', line 109 def add_issue(opts) issues << Issue.new(opts) end |
#error_count ⇒ Object
117 118 119 |
# File 'lib/ci-syntax-tool/result.rb', line 117 def error_count errors.count end |
#errors ⇒ Object
125 126 127 |
# File 'lib/ci-syntax-tool/result.rb', line 125 def errors issues.select { |i| i.level == :error } end |
#warning_count ⇒ Object
113 114 115 |
# File 'lib/ci-syntax-tool/result.rb', line 113 def warning_count warnings.count end |
#warnings ⇒ Object
121 122 123 |
# File 'lib/ci-syntax-tool/result.rb', line 121 def warnings issues.select { |i| i.level == :warning } end |