Class: CI::Syntax::Tool::Result::OverallResult
- Inherits:
-
CI::Syntax::Tool::Result
- Object
- CI::Syntax::Tool::Result
- CI::Syntax::Tool::Result::OverallResult
- Defined in:
- lib/ci-syntax-tool/result.rb
Instance Attribute Summary collapse
-
#language_results ⇒ Object
readonly
Returns the value of attribute language_results.
Instance Method Summary collapse
- #add_language_result(lang_name) ⇒ Object
- #error_count ⇒ Object
- #file_paths ⇒ Object
-
#initialize ⇒ OverallResult
constructor
A new instance of OverallResult.
- #report_failure? ⇒ Boolean
- #warning_count ⇒ Object
Constructor Details
#initialize ⇒ OverallResult
Returns a new instance of OverallResult.
27 28 29 |
# File 'lib/ci-syntax-tool/result.rb', line 27 def initialize @language_results = {} end |
Instance Attribute Details
#language_results ⇒ Object (readonly)
Returns the value of attribute language_results.
25 26 27 |
# File 'lib/ci-syntax-tool/result.rb', line 25 def language_results @language_results end |
Instance Method Details
#add_language_result(lang_name) ⇒ Object
31 32 33 |
# File 'lib/ci-syntax-tool/result.rb', line 31 def add_language_result(lang_name) language_results[lang_name] = LanguageResult.new(lang_name) end |
#error_count ⇒ Object
39 40 41 42 43 |
# File 'lib/ci-syntax-tool/result.rb', line 39 def error_count language_results.inject(0) do |total, (lang,result)| total += result.error_count end end |
#file_paths ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/ci-syntax-tool/result.rb', line 51 def file_paths files = [] language_results.each do |ln, lr| lr.file_results.each do |fp, fr| files << fr.path end end files end |
#report_failure? ⇒ Boolean
35 36 37 |
# File 'lib/ci-syntax-tool/result.rb', line 35 def report_failure? error_count > 0 end |
#warning_count ⇒ Object
45 46 47 48 49 |
# File 'lib/ci-syntax-tool/result.rb', line 45 def warning_count language_results.inject(0) do |total, (lang,result)| total += result.warning_count end end |