Sha256: 6cb23d347a1154a10789f67f60f209e2eea83b1e44c8a2d72b6526d1d0286393

Contents?: true

Size: 446 Bytes

Versions: 4

Compression:

Stored size: 446 Bytes

Contents

module DocxTools
  class Document

    # the stored zip file (docx)
    attr_accessor :zip

    # read the filepath and parse it as a zip file
    def initialize(filepath)
      self.zip = Zip::File.open(filepath)
    end

    # the entries contained within the zip
    def entries
      zip.entries
    end

    # read the file within the zip at the given filename
    def get(filename)
      Nokogiri::XML(zip.read(filename))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
docx_tools-0.0.4 lib/docx_tools/document.rb
docx_tools-0.0.3 lib/docx_tools/document.rb
docx_tools-0.0.2 lib/docx_tools/document.rb
docx_tools-0.0.1 lib/docx_tools/document.rb