Class: Burr::EpubMaker
Instance Method Summary collapse
- #identifier(id, options) ⇒ Object
-
#initialize(&block) ⇒ EpubMaker
constructor
A new instance of EpubMaker.
-
#render ⇒ Object
instead of saving to file, output the file contents.
-
#save(filename) ⇒ Object
Save as ePub file.
Constructor Details
#initialize(&block) ⇒ EpubMaker
Returns a new instance of EpubMaker.
47 48 49 50 51 52 53 54 |
# File 'lib/burr/eeepub_ext/maker.rb', line 47 def initialize(&block) @files ||= [] @nav ||= [] @ncx_file ||= 'toc.ncx' @opf_file ||= 'content.opf' instance_eval(&block) if block_given? end |
Instance Method Details
#identifier(id, options) ⇒ Object
41 42 43 44 |
# File 'lib/burr/eeepub_ext/maker.rb', line 41 def identifier(id, ) @identifiers ||= [] @identifiers << {:value => id, :scheme => [:scheme], :id => [:id]} end |
#render ⇒ Object
instead of saving to file, output the file contents. important for serving on-the-fly doc creation from web interface where we don’t want to allow file system writes (Heroku, et al.)
67 68 69 |
# File 'lib/burr/eeepub_ext/maker.rb', line 67 def render create_epub.render end |
#save(filename) ⇒ Object
Save as ePub file
59 60 61 |
# File 'lib/burr/eeepub_ext/maker.rb', line 59 def save(filename) create_epub.save(filename) end |