Sha256: 0e21b0f988027fbea46545522f3b1ccb603fb426cf6947011249a004ce8e7318

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

module Preek
  require 'preek/klass_collector'
  # A smelly file
  class SmellFile
    def initialize(smells)
      @smells = smells
      @klass_collector = KlassCollector.new
    end

    def klasses
      add_smells_to_klass
      @klass_collector.get_klasses
    end

    def file
      @smells.first.source
    end

  private
    def add_smells_to_klass
      @smells.each do |smell|
        @klass_collector.find(smell.klass).add_smell smell
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
preek-0.1.2 lib/preek/smell_file.rb
preek-0.1.1 lib/preek/smell_file.rb
preek-0.1.0 lib/preek/smell_file.rb