Class: CC::Analyzer::Formatters::HTMLFormatter::IssueCollection
- Inherits:
-
Object
- Object
- CC::Analyzer::Formatters::HTMLFormatter::IssueCollection
- Defined in:
- lib/cc/analyzer/formatters/html_formatter.rb
Instance Method Summary collapse
- #<<(issue) ⇒ Object
- #any? ⇒ Boolean
- #categories ⇒ Object
- #each(&block) ⇒ Object
- #engines ⇒ Object
-
#initialize(filesystem) ⇒ IssueCollection
constructor
A new instance of IssueCollection.
- #syntaxes ⇒ Object
Constructor Details
#initialize(filesystem) ⇒ IssueCollection
Returns a new instance of IssueCollection.
315 316 317 318 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 315 def initialize(filesystem) @collection = [] @filesystem = filesystem end |
Instance Method Details
#<<(issue) ⇒ Object
324 325 326 327 328 329 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 324 def <<(issue) if issue.is_a? Hash issue = Issue.new(issue, filesystem) end collection.push(issue) end |
#any? ⇒ Boolean
331 332 333 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 331 def any? collection.any? end |
#categories ⇒ Object
341 342 343 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 341 def categories collection.flat_map(&:categories).uniq.sort end |
#each(&block) ⇒ Object
320 321 322 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 320 def each(&block) collection.each(&block) end |
#engines ⇒ Object
345 346 347 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 345 def engines collection.map(&:engine_name).uniq.compact.sort end |
#syntaxes ⇒ Object
335 336 337 338 339 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 335 def syntaxes collection.flat_map do |issue| issue.source.syntaxes end.uniq.sort end |