Class: RTFDoc::Generator
- Inherits:
-
Object
- Object
- RTFDoc::Generator
- Defined in:
- lib/rtfdoc.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
Instance Method Summary collapse
-
#initialize(config_path) ⇒ Generator
constructor
A new instance of Generator.
- #run ⇒ Object
Constructor Details
#initialize(config_path) ⇒ Generator
Returns a new instance of Generator.
461 462 463 464 465 |
# File 'lib/rtfdoc.rb', line 461 def initialize(config_path) @config = YAML.load_file(config_path) @content_dir = @config['content_dir'] @parts = {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
459 460 461 |
# File 'lib/rtfdoc.rb', line 459 def config @config end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
459 460 461 |
# File 'lib/rtfdoc.rb', line 459 def renderer @renderer end |
Instance Method Details
#run ⇒ Object
467 468 469 470 471 472 473 474 |
# File 'lib/rtfdoc.rb', line 467 def run @tree = build_content_tree nodes = build_nodes(config['resources']) out = File.new("#{Dir.tmpdir}/rtfdoc_output.html", 'w') out.write(Template.new(nodes, config).output) out.close end |