Method: Docx::Document.open

Defined in:
lib/docx/document.rb

.open(path, &block) ⇒ Object

With no associated block, Docx::Document.open is a synonym for Docx::Document.new. If the optional code block is given, it will be passed the opened docx file as an argument and the Docx::Document oject will automatically be closed when the block terminates. The values of the block will be returned from Docx::Document.open. call-seq:

open(filepath) => file
open(filepath) {|file| block } => obj


56
57
58
# File 'lib/docx/document.rb', line 56

def self.open(path, &block)
  new(path, &block)
end