Class: Dry::Web::Roda::Generators::AbstractGenerator
- Inherits:
-
Object
- Object
- Dry::Web::Roda::Generators::AbstractGenerator
- Defined in:
- lib/dry/web/roda/generators/abstract_generator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target_dir ⇒ Object
readonly
Returns the value of attribute target_dir.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(target_dir, options = {}) ⇒ AbstractGenerator
constructor
A new instance of AbstractGenerator.
Constructor Details
#initialize(target_dir, options = {}) ⇒ AbstractGenerator
Returns a new instance of AbstractGenerator.
11 12 13 14 15 16 17 |
# File 'lib/dry/web/roda/generators/abstract_generator.rb', line 11 def initialize(target_dir, = {}) @target_dir = target_dir @options = @templates = [] populate_templates @templates.freeze end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/dry/web/roda/generators/abstract_generator.rb', line 9 def @options end |
#target_dir ⇒ Object (readonly)
Returns the value of attribute target_dir.
9 10 11 |
# File 'lib/dry/web/roda/generators/abstract_generator.rb', line 9 def target_dir @target_dir end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 |
# File 'lib/dry/web/roda/generators/abstract_generator.rb', line 19 def call templates.each do |source, target| generator.(source, target) end post_process_callback end |