Method: Axlsx::Package#serialize
- Defined in:
- lib/axlsx/package.rb
#serialize(output, confirm_valid = false) ⇒ Boolean
Note:
A tremendous amount of effort has gone into ensuring that you cannot create invalid xlsx documents. confirm_valid should be used in the rare case that you cannot open the serialized file.
Serialize your workbook to disk as an xlsx document.
101 102 103 104 105 106 107 108 |
# File 'lib/axlsx/package.rb', line 101 def serialize(output, confirm_valid=false) return false unless !confirm_valid || self.validate.empty? Relationship.clear_cached_instances Zip::OutputStream.open(output) do |zip| write_parts(zip) end true end |