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.
319 320 321 322 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 319 def initialize(filesystem) @collection = [] @filesystem = filesystem end |
Instance Method Details
#<<(issue) ⇒ Object
328 329 330 331 332 333 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 328 def <<(issue) if issue.is_a? Hash issue = Issue.new(issue, filesystem) end collection.push(issue) end |
#any? ⇒ Boolean
335 336 337 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 335 def any? collection.any? end |
#categories ⇒ Object
345 346 347 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 345 def categories collection.flat_map(&:categories).uniq.sort end |
#each(&block) ⇒ Object
324 325 326 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 324 def each(&block) collection.each(&block) end |
#engines ⇒ Object
349 350 351 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 349 def engines collection.map(&:engine_name).uniq.compact.sort end |
#syntaxes ⇒ Object
339 340 341 342 343 |
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 339 def syntaxes collection.flat_map do |issue| issue.source.syntaxes end.uniq.sort end |