class Spreadsheet::Writer

Parent Class for all Writers. Implements the copying of unmodified Spreadsheet documents.

Public Class Methods

new(io_or_path) click to toggle source
# File lib/spreadsheet/writer.rb, line 6
def initialize io_or_path
  @io_or_path = io_or_path
end

Public Instance Methods

write(workbook) click to toggle source
# File lib/spreadsheet/writer.rb, line 9
def write workbook
  if @io_or_path.respond_to? :seek
    @io_or_path.binmode
    write_workbook workbook, @io_or_path
  else
    File.open(@io_or_path, "wb+") do |fh|
      write_workbook workbook, fh
    end
  end
end