Class: Reek::Smells::ControlParameter::ControlParameterCollector Private

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/smells/control_parameter.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 all control parameters in a given context.

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ControlParameterCollector

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 ControlParameterCollector.



166
167
168
# File 'lib/reek/smells/control_parameter.rb', line 166

def initialize(context)
  @context = context
end

Instance Method Details

#control_parametersObject

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.



170
171
172
173
174
# File 'lib/reek/smells/control_parameter.rb', line 170

def control_parameters
  potential_parameters.
    map { |param| FoundControlParameter.new(param, find_matches(param)) }.
    select(&:smells?)
end