Module: StyleScanner::Problems

Defined in:
lib/style_scanner/problems/base.rb

Defined Under Namespace

Classes: Base

Class Method Summary collapse

Class Method Details

.dynamically_generate_problem_classesObject



37
38
39
40
41
42
# File 'lib/style_scanner/problems/base.rb', line 37

def self.dynamically_generate_problem_classes
  problem_class_names_from_dir.each do |problem_class_name|
    eval %Q{ class #{problem_class_name} < Base
             end}
  end
end

.problem_class_names_from_dirObject



30
31
32
33
34
35
# File 'lib/style_scanner/problems/base.rb', line 30

def self.problem_class_names_from_dir
  Dir[(File.dirname(__FILE__) + "/../sentence_scans/*.rb")].
  map {|filename| File.basename(filename, ".rb").
  split("_").
  map(&:capitalize).join } - ["Base"]
end