Class: TyranoDsl::Writer
- Inherits:
-
Object
- Object
- TyranoDsl::Writer
- Defined in:
- lib/tyrano_dsl/writer.rb
Overview
Write the content that have been parsed
Instance Method Summary collapse
-
#initialize ⇒ Writer
constructor
A new instance of Writer.
- #write(world, parsed_words) ⇒ TyranoDsl::WritingContext
Constructor Details
#initialize ⇒ Writer
Returns a new instance of Writer.
15 16 17 18 19 20 21 |
# File 'lib/tyrano_dsl/writer.rb', line 15 def initialize @logger = Logger.new(STDOUT) @words = {} TyranoDsl::Vocabulary.get_words_class('writing_words') do |word, word_class| @words[word] = word_class.new end end |
Instance Method Details
#write(world, parsed_words) ⇒ TyranoDsl::WritingContext
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/tyrano_dsl/writer.rb', line 27 def write(world, parsed_words) log {'Writing content'} writing_context = TyranoDsl::WritingContext.new(world) write_title_screen(writing_context, world) write_backgrounds(writing_context, world) write_characters(writing_context, world) write_scenes(writing_context, world, parsed_words) write_variables(writing_context, world) writing_context.end_writing log {'Content written'} writing_context end |