Class: Ella::Generator
- Inherits:
-
Object
- Object
- Ella::Generator
- Defined in:
- lib/ella/generator.rb
Overview
This is an abstract class for the numerous generators that make up the bulk of this project. It cannot be run on its own. TODO: The first parameter should be part of the hash, for clarity.
Direct Known Subclasses
ConfigGenerator, ControllerGenerator, Destroyer, GemfileGenerator, ModelGenerator, ProjectGenerator, RackfileGenerator, ViewGenerator
Instance Method Summary collapse
-
#initialize(directory: nil, files: [], templates: [], template_vars: {}) ⇒ Generator
constructor
A new instance of Generator.
- #run ⇒ Object
Constructor Details
#initialize(directory: nil, files: [], templates: [], template_vars: {}) ⇒ Generator
8 9 10 11 12 13 |
# File 'lib/ella/generator.rb', line 8 def initialize(directory: nil, files: [], templates: [], template_vars: {}) @directory = NameFormatter.new(directory) if directory @files = files @templates = templates @template_vars = template_vars end |
Instance Method Details
#run ⇒ Object
15 16 17 |
# File 'lib/ella/generator.rb', line 15 def run raise NotImplementedError, 'Subclasses must define \'run\'.' end |