Class: Preek::SmellKlass
- Inherits:
-
Object
- Object
- Preek::SmellKlass
- Defined in:
- lib/preek/smell_klass.rb
Overview
A container for a smelly klass in a file!
Instance Method Summary collapse
- #add(smell) ⇒ Object
-
#initialize ⇒ SmellKlass
constructor
A new instance of SmellKlass.
- #name ⇒ Object
- #smells ⇒ Object
Constructor Details
#initialize ⇒ SmellKlass
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 |
#name ⇒ Object
12 13 14 |
# File 'lib/preek/smell_klass.rb', line 12 def name @smells.first.klass end |
#smells ⇒ Object
16 17 18 |
# File 'lib/preek/smell_klass.rb', line 16 def smells @smells.map(&:smell_string) end |