Method: Docx::Parser#initialize
- Defined in:
- lib/docx/parser.rb
#initialize(path) ⇒ Parser
Returns a new instance of Parser.
10 11 12 13 14 15 16 17 18 |
# File 'lib/docx/parser.rb', line 10 def initialize(path) @zip = Zip::ZipFile.open(path) @xml = @zip.read('word/document.xml') @doc = Nokogiri::XML(@xml) if block_given? yield self @zip.close end end |