Class | Spreadsheet::Writer |
In: |
lib/spreadsheet/writer.rb
|
Parent: | Object |
Parent Class for all Writers. Implements the copying of unmodified Spreadsheet documents.
# File lib/spreadsheet/writer.rb, line 6 6: def initialize io_or_path 7: @io_or_path = io_or_path 8: end
# File lib/spreadsheet/writer.rb, line 9 9: def write workbook 10: if @io_or_path.respond_to? :seek 11: @io_or_path.binmode 12: write_workbook workbook, @io_or_path 13: else 14: File.open(@io_or_path, "wb+") do |fh| 15: write_workbook workbook, fh 16: end 17: end 18: end