Class: ImproveYourCode::Examiner
- Inherits:
-
Object
- Object
- ImproveYourCode::Examiner
- Defined in:
- lib/improve_your_code/examiner.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(source) ⇒ Examiner
constructor
A new instance of Examiner.
- #smells ⇒ Object
- #smells_count ⇒ Object
- #smelly? ⇒ Boolean
Constructor Details
#initialize(source) ⇒ Examiner
Returns a new instance of Examiner.
9 10 11 12 |
# File 'lib/improve_your_code/examiner.rb', line 9 def initialize(source) @source = Source::SourceCode.from(source) @smell_types = DetectorRepository.eligible_smell_types end |
Instance Method Details
#description ⇒ Object
14 15 16 |
# File 'lib/improve_your_code/examiner.rb', line 14 def description @description ||= source.origin end |
#smells ⇒ Object
18 19 20 |
# File 'lib/improve_your_code/examiner.rb', line 18 def smells @smells ||= examine_tree.sort.uniq end |
#smells_count ⇒ Object
22 23 24 |
# File 'lib/improve_your_code/examiner.rb', line 22 def smells_count smells.length end |
#smelly? ⇒ Boolean
26 27 28 |
# File 'lib/improve_your_code/examiner.rb', line 26 def smelly? smells.any? end |