Module: Book::Features

Defined in:
lib/epub/maker.rb

Instance Method Summary collapse

Instance Method Details

#make_ocfObject



105
106
107
108
109
110
111
# File 'lib/epub/maker.rb', line 105

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

#make_packageObject



113
114
115
116
117
118
119
120
121
122
# File 'lib/epub/maker.rb', line 113

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

#saveObject



124
125
126
127
128
# File 'lib/epub/maker.rb', line 124

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