class Odf::Document::Abstract

Constants

COMPONENTS

Attributes

creator[W]

Public Class Methods

new() click to toggle source
# File lib/odf/document/abstract.rb, line 11
def initialize
  @content   = Odf::Component::Content.new(self)
  @image_set = Odf::Component::ImageSet.new(self)
  @manifest  = Odf::Component::Manifest.new(self)
  @meta      = Odf::Component::Meta.new(self)
  @mime_type = Odf::Component::MimeType.new(self)
  @settings  = Odf::Component::Settings.new(self)
  @styles    = Odf::Component::Styles.new(self)
end

Public Instance Methods

add_image(uri) click to toggle source
# File lib/odf/document/abstract.rb, line 58
def add_image(uri)
  image_set << uri
end
components() click to toggle source

Returns the components of the document.

# File lib/odf/document/abstract.rb, line 39
def components
  COMPONENTS
end
creator() click to toggle source

Returns the creator information.

# File lib/odf/document/abstract.rb, line 44
def creator
  @creator || Odf.creator
end
extension() click to toggle source

Returns the file extension for open document format.

# File lib/odf/document/abstract.rb, line 30
def extension
  self.class::EXTENSION
end
media_type() click to toggle source

Returns the mime type of document. All subclasses of this abstract class should define the MIME_TYPE constant.

# File lib/odf/document/abstract.rb, line 24
def media_type
  self.class::MIME_TYPE
end
root() click to toggle source
# File lib/odf/document/abstract.rb, line 62
def root
  content.root
end
serialize(file_name) click to toggle source

Serialize the document to given path.

# File lib/odf/document/abstract.rb, line 49
def serialize(file_name)
  Odf::Utils::File.serialize(file_name, self) && true
end
to_blob() click to toggle source

Returns the output stream.

# File lib/odf/document/abstract.rb, line 54
def to_blob
  Odf::Utils::File.output_stream(self)
end
wrapper() click to toggle source
# File lib/odf/document/abstract.rb, line 34
def wrapper
  self.class::WRAPPER
end