Class: Preek::SmellKlass

Inherits:
Object
  • Object
show all
Defined in:
lib/preek/smell_klass.rb

Overview

A container for a smelly klass in a file!

Instance Method Summary collapse

Constructor Details

#initializeSmellKlass

Returns a new instance of SmellKlass.



4
5
6
# File 'lib/preek/smell_klass.rb', line 4

def initialize
  @smells = []
end

Instance Method Details

#add(smell) ⇒ Object



8
9
10
# File 'lib/preek/smell_klass.rb', line 8

def add(smell)
  @smells << smell
end

#nameObject



12
13
14
# File 'lib/preek/smell_klass.rb', line 12

def name
  @smells.first.klass
end

#smellsObject



16
17
18
# File 'lib/preek/smell_klass.rb', line 16

def smells
  @smells.map(&:smell_string)
end