class Makimono::Generator

Attributes

generator[R]

Public Class Methods

from_config(config) click to toggle source
# File lib/makimono/generator.rb, line 8
def self.from_config(config)
  klass = if config[:generator].upcase == 'EPUB'
            Epub
          elsif config[:generator] == 'SimpleFile'
            SimpleFile
          else
            const_get(config[:generator].to_s)
          end
  new(klass.new(config))
rescue NameError
  raise InvalidGeneratorError, "Invalid generator configuration: #{config[:generator]}"
end
new(generator) click to toggle source
# File lib/makimono/generator.rb, line 23
def initialize(generator)
  @generator = generator
end

Public Instance Methods

generate(documents) click to toggle source
# File lib/makimono/generator.rb, line 27
def generate(documents)
  generator.generate(documents)
end