Class: RailsBestPractices::Core::ChecksLoader
- Inherits:
-
Object
- Object
- RailsBestPractices::Core::ChecksLoader
- Defined in:
- lib/rails_best_practices/core/checks_loader.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ ChecksLoader
constructor
A new instance of ChecksLoader.
-
#load_lexicals ⇒ Object
load all lexical checks.
-
#load_reviews ⇒ Object
load all reviews according to configuration.
Constructor Details
#initialize(config) ⇒ ChecksLoader
Returns a new instance of ChecksLoader.
6 7 8 |
# File 'lib/rails_best_practices/core/checks_loader.rb', line 6 def initialize(config) @config = config end |
Instance Method Details
#load_lexicals ⇒ Object
load all lexical checks.
11 12 13 |
# File 'lib/rails_best_practices/core/checks_loader.rb', line 11 def load_lexicals load_checks_from_config { |check_name| RailsBestPractices::Lexicals.const_get(check_name) } end |
#load_reviews ⇒ Object
load all reviews according to configuration.
16 17 18 19 20 |
# File 'lib/rails_best_practices/core/checks_loader.rb', line 16 def load_reviews load_checks_from_config do |check_name| RailsBestPractices::Reviews.const_get(check_name.gsub(/Check$/, 'Review')) end end |