Class: CI::Syntax::Tool::Result::LanguageResult
- Inherits:
-
CI::Syntax::Tool::Result
- Object
- CI::Syntax::Tool::Result
- CI::Syntax::Tool::Result::LanguageResult
- Defined in:
- lib/ci-syntax-tool/result.rb
Instance Attribute Summary collapse
-
#file_results ⇒ Object
readonly
Returns the value of attribute file_results.
-
#language_name ⇒ Object
readonly
Returns the value of attribute language_name.
Instance Method Summary collapse
- #add_file_result(path) ⇒ Object
- #error_count ⇒ Object
- #error_file_results ⇒ Object
-
#initialize(lang_name) ⇒ LanguageResult
constructor
A new instance of LanguageResult.
- #warning_count ⇒ Object
- #warning_file_results ⇒ Object
Constructor Details
#initialize(lang_name) ⇒ LanguageResult
Returns a new instance of LanguageResult.
68 69 70 71 |
# File 'lib/ci-syntax-tool/result.rb', line 68 def initialize(lang_name) @language_name = lang_name @file_results = {} end |
Instance Attribute Details
#file_results ⇒ Object (readonly)
Returns the value of attribute file_results.
65 66 67 |
# File 'lib/ci-syntax-tool/result.rb', line 65 def file_results @file_results end |
#language_name ⇒ Object (readonly)
Returns the value of attribute language_name.
66 67 68 |
# File 'lib/ci-syntax-tool/result.rb', line 66 def language_name @language_name end |
Instance Method Details
#add_file_result(path) ⇒ Object
73 74 75 |
# File 'lib/ci-syntax-tool/result.rb', line 73 def add_file_result(path) file_results[path] = FileResult.new(path) end |
#error_count ⇒ Object
77 78 79 80 81 |
# File 'lib/ci-syntax-tool/result.rb', line 77 def error_count file_results.inject(0) do |total, (path,result)| total += result.error_count end end |
#error_file_results ⇒ Object
93 94 95 |
# File 'lib/ci-syntax-tool/result.rb', line 93 def error_file_results file_results.values.select { |fr| fr.error_count > 0 } end |
#warning_count ⇒ Object
83 84 85 86 87 |
# File 'lib/ci-syntax-tool/result.rb', line 83 def warning_count file_results.inject(0) do |total, (path,result)| total += result.warning_count end end |
#warning_file_results ⇒ Object
89 90 91 |
# File 'lib/ci-syntax-tool/result.rb', line 89 def warning_file_results file_results.values.select { |fr| fr.warning_count > 0 } end |