Class: Preek::SmellFile

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

Overview

A smelly file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(smells, excludes) ⇒ SmellFile

Returns a new instance of SmellFile.



6
7
8
9
10
11
# File 'lib/preek/smell_file.rb', line 6

def initialize(smells, excludes)
  @smells = smells
  @excludes = excludes
  @klasses = {}
  add_smells_to_klasses
end

Instance Attribute Details

#klassesObject (readonly)

Returns the value of attribute klasses.



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

def klasses
  @klasses
end

Instance Method Details

#fileObject Also known as: filename



13
14
15
# File 'lib/preek/smell_file.rb', line 13

def file
  @smells.first.source
end