lib/axlsx/package.rb in axlsx-1.0.10 vs lib/axlsx/package.rb in axlsx-1.0.11

- old
+ new

@@ -14,16 +14,10 @@ @core, @app = Core.new, App.new @core.creator = options[:author] || @core.creator yield self if block_given? end - # Accepts a ruport table for serialization to xlsx - # @param [Table] table a ruport Table object - def ruport_table(table) - puts table - end - # The workbook this package will serialize or validate. # @return [Workbook] If no workbook instance has been assigned with this package a new Workbook instance is returned. # @raise ArgumentError if workbook parameter is not a Workbook instance. # @note As there are multiple ways to instantiate a workbook for the package, # here are a few examples: @@ -37,10 +31,17 @@ def workbook @workbook || @workbook = Workbook.new yield @workbook if block_given? @workbook end + + #def self.parse(input, confirm_valid = false) + # p = Package.new + # z = Zip::ZipFile.open(input) + # p.workbook = Workbook.parse z.get_entry(WORKBOOK_PN) + # p + #end # @see workbook def workbook=(workbook) DataTypeValidator.validate "Package.workbook", Workbook, workbook; @workbook = workbook; end # Serialize your workbook to disk as an xlsx document. @@ -74,10 +75,11 @@ end end end true end - + + # Validate all parts of the package against xsd schema. # @return [Array] An array of all validation errors found. # @note This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip and OpenPackagingConventions-XMLSchema.zip # as per ECMA-376, Third edition. opc schema require an internet connection to import remote schema from dublin core for dc, # dcterms and xml namespaces. Those remote schema are included in this gem, and the original files have been altered to