Class: FaviconMaker::Generator
- Inherits:
-
Object
- Object
- FaviconMaker::Generator
- Extended by:
- Forwardable
- Defined in:
- lib/favicon_maker/generator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#creators ⇒ Object
Returns the value of attribute creators.
-
#finished_block ⇒ Object
Returns the value of attribute finished_block.
Instance Method Summary collapse
- #each_icon(&block) ⇒ Object
- #from(template_filename, &block) ⇒ Object
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
- #setup(&block) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
20 21 22 |
# File 'lib/favicon_maker/generator.rb', line 20 def initialize @creators = {} end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
14 15 16 |
# File 'lib/favicon_maker/generator.rb', line 14 def config @config end |
#creators ⇒ Object
Returns the value of attribute creators.
15 16 17 |
# File 'lib/favicon_maker/generator.rb', line 15 def creators @creators end |
#finished_block ⇒ Object
Returns the value of attribute finished_block.
16 17 18 |
# File 'lib/favicon_maker/generator.rb', line 16 def finished_block @finished_block end |
Instance Method Details
#each_icon(&block) ⇒ Object
32 33 34 |
# File 'lib/favicon_maker/generator.rb', line 32 def each_icon(&block) @finished_block = block end |
#from(template_filename, &block) ⇒ Object
28 29 30 |
# File 'lib/favicon_maker/generator.rb', line 28 def from(template_filename, &block) creators[template_filename] = block end |
#setup(&block) ⇒ Object
24 25 26 |
# File 'lib/favicon_maker/generator.rb', line 24 def setup(&block) @config = Docile.dsl_eval(MakerConfig.new, &block) end |
#start ⇒ Object
36 37 38 39 40 41 |
# File 'lib/favicon_maker/generator.rb', line 36 def start creators.each do |template_filename, creator_block| template_file = File.join(template_dir, template_filename) Docile.dsl_eval(Creator.new(template_file, output_dir, finished_block), &creator_block) end end |