class Kanji::Generators::AbstractGenerator
Attributes
target_dir[R]
templates[R]
Public Class Methods
new(target_dir)
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 7 def initialize(target_dir) @target_dir = target_dir @templates = [] populate_templates @templates.freeze end
Public Instance Methods
call()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 14 def call templates.each do |source, target| generator.(source, target) end post_process_callback end
Private Instance Methods
add_template(source, target)
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 33 def add_template(source, target) templates << [source, target] end
destination()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 41 def destination fail NotImplementedError end
generator()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 37 def generator @generator ||= Generate.new(destination, template_scope) end
populate_templates()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 25 def populate_templates fail NotImplementedError end
post_process_callback()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 29 def post_process_callback end
template_scope()
click to toggle source
# File lib/kanji/generators/abstract_generator.rb, line 45 def template_scope fail NotImplementedError end