class Reek::SmellDetectors::ControlParameterHelpers::Candidate
Collects information about a single control parameter.
Attributes
Public Class Methods
Source
# File lib/reek/smell_detectors/control_parameter_helpers/candidate.rb, line 15 def initialize(parameter, occurrences) @parameter = parameter @occurrences = occurrences end
@param parameter [Symbol] the parameter name @param occurrences [Array<Reek::AST::Node>] the occurrences of the ControlParameter
smell
e.g. [s(:lvar, :bravo), s(:lvar, :bravo)]
Public Instance Methods
Source
# File lib/reek/smell_detectors/control_parameter_helpers/candidate.rb, line 24 def lines occurrences.map(&:line) end
Source
# File lib/reek/smell_detectors/control_parameter_helpers/candidate.rb, line 28 def name parameter.to_s end
Source
# File lib/reek/smell_detectors/control_parameter_helpers/candidate.rb, line 20 def smells? occurrences.any? end