Class: Yarrow::Generator
- Inherits:
-
Object
- Object
- Yarrow::Generator
- Defined in:
- lib/yarrow/generator.rb
Overview
Generates documentation from a model.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
private.
-
#workflow ⇒ Object
readonly
private.
Instance Method Summary collapse
- #generate ⇒ Object
- #generators ⇒ Object
-
#initialize(config) ⇒ Generator
constructor
A new instance of Generator.
- #process(&block) ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
private
63 64 65 |
# File 'lib/yarrow/generator.rb', line 63 def config @config end |
#workflow ⇒ Object (readonly)
private
63 64 65 |
# File 'lib/yarrow/generator.rb', line 63 def workflow @workflow end |
Instance Method Details
#generate ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/yarrow/generator.rb', line 53 def generate process do |manifest| generators.each do |generator| generator.generate(manifest) end end end |
#generators ⇒ Object
65 66 67 |
# File 'lib/yarrow/generator.rb', line 65 def generators [Web::Generator.new(config)] end |
#process(&block) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/yarrow/generator.rb', line 43 def process(&block) workflow.connect(ScanSource.new) workflow.connect(ExpandCollections.new) workflow.connect(FlattenManifest.new) workflow.process do |result| block.call(result) end end |