Class: UCF::File

Inherits:
ZipContainer::File
  • Object
show all
Defined in:
lib/ucf/file.rb

Overview

This class represents a UCF document file - also known as an EPUB and very similar to the EPUB Open Container Format (OCF). See the UCF specification for more details.

This class is a specialization of ZipContainer::File so you should see the ZipContainer documentation for much more information and a list of all the other methods available in this class. RDoc does not list inherited methods, unfortunately.

There are code examples available with the source code of this library.

Constant Summary collapse

DEFAULT_MIMETYPE =

:stopdoc:

"application/epub+zip"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ File

Returns a new instance of File.



56
57
58
59
60
61
# File 'lib/ucf/file.rb', line 56

def initialize(filename)
  super(filename)

  # Initialize the managed entries and register the META-INF directory.
  initialize_managed_entries(MetaInf.new)
end

Class Method Details

.create(filename, mimetype = DEFAULT_MIMETYPE, &block) ⇒ Object

:call-seq:

create(filename) -> UCF::File
create(filename, mimetype) -> UCF::FILE
create(filename) {|file| ...}
create(filename, mimetype) {|file| ...}

Create a new UCF document file on disk and open it for editing. A custom mimetype for the container may be specified but if not the default, “application/epub+zip”, will be used.

Please see the ZipContainer documentation for much more information and a list of all the other methods available in this class. RDoc does not list inherited methods, unfortunately.



78
79
80
# File 'lib/ucf/file.rb', line 78

def self.create(filename, mimetype = DEFAULT_MIMETYPE, &block)
  super(filename, mimetype, &block)
end