Class: GhostWriter::Writer
- Inherits:
-
Object
- Object
- GhostWriter::Writer
- Defined in:
- lib/ghost_writer/writer.rb,
lib/ghost_writer/writer/rst.rb,
lib/ghost_writer/writer/base.rb,
lib/ghost_writer/writer/markdown.rb
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(document, options = {}) ⇒ Writer
constructor
A new instance of Writer.
- #write_file ⇒ Object
Constructor Details
#initialize(document, options = {}) ⇒ Writer
Returns a new instance of Writer.
7 8 9 10 11 |
# File 'lib/ghost_writer/writer.rb', line 7 def initialize(document, = {}) @document = document @format = .delete(:format) || :markdown = end |
Instance Method Details
#write_file ⇒ Object
13 14 15 16 17 |
# File 'lib/ghost_writer/writer.rb', line 13 def write_file format_class = lookup_format_class format = format_class.new(@document, ) format.write_file end |