Class: Reek::Smells::ControlParameter::FoundControlParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/smells/control_parameter.rb

Overview

Collects information about a single control parameter.

Instance Method Summary collapse

Constructor Details

#initialize(param, occurences) ⇒ FoundControlParameter

Returns a new instance of FoundControlParameter


68
69
70
71
# File 'lib/reek/smells/control_parameter.rb', line 68

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

Instance Method Details

#linesObject


77
78
79
# File 'lib/reek/smells/control_parameter.rb', line 77

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

#nameObject


81
82
83
# File 'lib/reek/smells/control_parameter.rb', line 81

def name
  @param.to_s
end

#smells?Boolean

Returns:

  • (Boolean)

73
74
75
# File 'lib/reek/smells/control_parameter.rb', line 73

def smells?
  @occurences.any?
end