Sha256: 4fe2f32933dd36ee56a8da118b1df99aa422376433ebb3064d259a498433d260
Contents?: true
Size: 824 Bytes
Versions: 22
Compression:
Stored size: 824 Bytes
Contents
# frozen_string_literal: true module Reek module SmellDetectors module ControlParameterHelpers # # Collects information about a single control parameter. # class Candidate # # @param parameter [Symbol] the parameter name # @param occurences [Array<Reek::AST::Node>] the occurences of the ControlParameter smell # e.g. [s(:lvar, :bravo), s(:lvar, :bravo)] # def initialize(parameter, occurences) @parameter = parameter @occurences = occurences end def smells? occurences.any? end def lines occurences.map(&:line) end def name parameter.to_s end private attr_reader :occurences, :parameter end end end end
Version data entries
22 entries across 20 versions & 2 rubygems