Class: Reek::Smells::ControlParameter::FoundControlParameter 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 information about a single control parameter.

Instance Method Summary collapse

Constructor Details

#initialize(param, occurences) ⇒ FoundControlParameter

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



70
71
72
73
# File 'lib/reek/smells/control_parameter.rb', line 70

def initialize(param, occurences)
  @param = param
  @occurences = occurences
end

Instance Method Details

#linesObject

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.



79
80
81
# File 'lib/reek/smells/control_parameter.rb', line 79

def lines
  @occurences.map(&:line)
end

#nameObject

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.



83
84
85
# File 'lib/reek/smells/control_parameter.rb', line 83

def name
  @param.to_s
end

#smells?Boolean

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:

  • (Boolean)


75
76
77
# File 'lib/reek/smells/control_parameter.rb', line 75

def smells?
  @occurences.any?
end