class Ebookie::Document::Base

Attributes

chapters[R]
config[R]
images[R]

Public Class Methods

new(title) click to toggle source
# File lib/ebookie/document/base.rb, line 7
def initialize(title)
  @chapters = []
  @images = []

  @config = Config.new
  @config.title = title
end

Public Instance Methods

chapter(title, content) click to toggle source
# File lib/ebookie/document/base.rb, line 19
def chapter(title, content)
  @chapters << Chapter.new(title, content)
end
configure() { |config| ... } click to toggle source
# File lib/ebookie/document/base.rb, line 15
def configure(&block)
  yield @config
end
image(file) click to toggle source
# File lib/ebookie/document/base.rb, line 23
def image(file)
  @images << Image.new(file)
end
method_missing(meth, *args) click to toggle source
Calls superclass method
# File lib/ebookie/document/base.rb, line 39
def method_missing(meth, *args)
  if @config.respond_to?(meth)
    @config.send(meth, *args)
  else
    super
  end
end
render_epub() click to toggle source
# File lib/ebookie/document/base.rb, line 31
def render_epub
  Rendering::Epub.new(self).render
end
render_mobi() click to toggle source
# File lib/ebookie/document/base.rb, line 35
def render_mobi
  Rendering::Mobi.new(self).render
end
render_pdf() click to toggle source
# File lib/ebookie/document/base.rb, line 27
def render_pdf
  Rendering::Pdf.new(self).render
end