Class: Makimono::Processor
- Inherits:
-
Object
- Object
- Makimono::Processor
- Defined in:
- lib/makimono/processor.rb
Instance Method Summary collapse
-
#initialize(config, converter: Converter.from_config(config), generator: Generator.from_config(config)) ⇒ Processor
constructor
A new instance of Processor.
- #process(resources = ResourceList.from_dir(@config[:source])) ⇒ Object
Constructor Details
#initialize(config, converter: Converter.from_config(config), generator: Generator.from_config(config)) ⇒ Processor
Returns a new instance of Processor.
9 10 11 12 13 |
# File 'lib/makimono/processor.rb', line 9 def initialize(config, converter: Converter.from_config(config), generator: Generator.from_config(config)) @config = config @converter = converter @generator = generator end |
Instance Method Details
#process(resources = ResourceList.from_dir(@config[:source])) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/makimono/processor.rb', line 15 def process(resources = ResourceList.from_dir(@config[:source])) converted_resources = resources.map do |resource| @converter.convert(resource) end @generator.generate(converted_resources) end |