class DocxTools::Document

Attributes

zip[RW]

the stored zip file (docx)

Public Class Methods

new(filepath) click to toggle source

read the filepath and parse it as a zip file

# File lib/docx_tools/document.rb, line 8
def initialize(filepath)
  self.zip = Zip::File.open(filepath)
end

Public Instance Methods

entries() click to toggle source

the entries contained within the zip

# File lib/docx_tools/document.rb, line 13
def entries
  zip.entries
end
get(filename) click to toggle source

read the file within the zip at the given filename

# File lib/docx_tools/document.rb, line 18
def get(filename)
  Nokogiri::XML(zip.read(filename))
end