Module: Book::Features

Defined in:
lib/epub/maker.rb

Instance Method Summary collapse

Instance Method Details

#make_ocfObject



67
68
69
70
71
72
73
# File 'lib/epub/maker.rb', line 67

def make_ocf
  self.ocf = OCF.new
  ocf.make do |ocf|
    yield ocf if block_given?
  end
  ocf
end

#make_packageObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/epub/maker.rb', line 75

def make_package
  package = Publication::Package.new
  package.book = self
  package.make do |package|
    yield package if block_given?
  end
  no_package_rootfile = rootfiles.find {|rf| rf.package.nil?}
  no_package_rootfile.package = package if no_package_rootfile
  package
end

#saveObject



86
87
88
89
90
# File 'lib/epub/maker.rb', line 86

def save
  ocf.save
  packages.each(&:save)
  resources.each(&:save)
end