Sha256: c3f91be188d15c985913385602bff3ab87b2e28c15d5807b6359611211b7e8db
Contents?: true
Size: 656 Bytes
Versions: 7
Compression:
Stored size: 656 Bytes
Contents
module Spreadsheet ## # Parent Class for all Writers. Implements the copying of unmodified # Spreadsheet documents. class Writer def initialize io_or_path @io_or_path = io_or_path end def write workbook if @io_or_path.respond_to? :seek write_workbook workbook, @io_or_path else File.open(@io_or_path, "wb+") do |fh| write_workbook workbook, fh end end end private def write_workbook workbook, io reader = workbook.io unless io == reader reader.rewind data = reader.read io.rewind io.write data end end end end
Version data entries
7 entries across 7 versions & 1 rubygems