Class: Docxi::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/docxi/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {top: 720,right: 1440,left: 1440,bottom: 720,footer: 200, header: 190}) ⇒ Document

Returns a new instance of Document.



6
7
8
# File 'lib/docxi/document.rb', line 6

def initialize(options = {top: 720,right: 1440,left: 1440,bottom: 720,footer: 200, header: 190})
  @options = options
end

Instance Attribute Details

#content_typesObject

Returns the value of attribute content_types.



4
5
6
# File 'lib/docxi/document.rb', line 4

def content_types
  @content_types
end

#documentObject

Returns the value of attribute document.



4
5
6
# File 'lib/docxi/document.rb', line 4

def document
  @document
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/docxi/document.rb', line 4

def options
  @options
end

#propertiesObject

Returns the value of attribute properties.



4
5
6
# File 'lib/docxi/document.rb', line 4

def properties
  @properties
end

#relationshipsObject

Returns the value of attribute relationships.



4
5
6
# File 'lib/docxi/document.rb', line 4

def relationships
  @relationships
end

Instance Method Details

#renderObject



26
27
28
29
30
31
32
33
# File 'lib/docxi/document.rb', line 26

def render
  Zip::ZipOutputStream.write_buffer do |zip|
    document.render(zip)
    properties.render(zip)
    relationships.render(zip)
    content_types.render(zip)
  end
end