Class: Fyodor::OutputWriter

Inherits:
Object
  • Object
show all
Includes:
Strings
Defined in:
lib/fyodor/output_writer.rb

Constant Summary

Constants included from Strings

Strings::PLURAL, Strings::SINGULAR

Instance Method Summary collapse

Constructor Details

#initialize(book, output_dir, config) ⇒ OutputWriter

Returns a new instance of OutputWriter.



9
10
11
12
13
# File 'lib/fyodor/output_writer.rb', line 9

def initialize(book, output_dir, config)
  @book = book
  @output_dir = output_dir
  @config = config
end

Instance Method Details

#writeObject



15
16
17
18
# File 'lib/fyodor/output_writer.rb', line 15

def write
  output = OutputGenerator.new(@book, @config).output
  File.open(path, "w") { |f| f.puts(output) }
end