Class: Reek::CLI::WarningCollector Private

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/cli/warning_collector.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Collects and sorts smells warnings.

Instance Method Summary collapse

Constructor Details

#initializeWarningCollector

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of WarningCollector.



10
11
12
# File 'lib/reek/cli/warning_collector.rb', line 10

def initialize
  @warnings = Set.new
end

Instance Method Details

#found_smell(warning) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/reek/cli/warning_collector.rb', line 14

def found_smell(warning)
  @warnings.add(warning)
end

#warningsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/reek/cli/warning_collector.rb', line 18

def warnings
  @warnings.to_a.sort
end