Class: Guideline::CheckerFactory
- Inherits:
-
Object
- Object
- Guideline::CheckerFactory
- Defined in:
- lib/guideline/checker_factory.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(options, *checker_classes) ⇒ CheckerFactory
constructor
A new instance of CheckerFactory.
- #options_for(klass) ⇒ Object
Constructor Details
#initialize(options, *checker_classes) ⇒ CheckerFactory
Returns a new instance of CheckerFactory.
3 4 5 6 |
# File 'lib/guideline/checker_factory.rb', line 3 def initialize(, *checker_classes) @options = @checker_classes = checker_classes end |
Instance Method Details
#create ⇒ Object
8 9 10 11 12 |
# File 'lib/guideline/checker_factory.rb', line 8 def create @checker_classes.map do |klass| klass.new((klass)) end end |
#options_for(klass) ⇒ Object
14 15 16 |
# File 'lib/guideline/checker_factory.rb', line 14 def (klass) @options[klass.to_s] || {} end |