Module: CSVPlusPlus::Writer
- Defined in:
- lib/csv_plus_plus/writer.rb,
lib/csv_plus_plus/writer/csv.rb,
lib/csv_plus_plus/writer/excel.rb,
lib/csv_plus_plus/writer/base_writer.rb,
lib/csv_plus_plus/writer/google_sheets.rb,
lib/csv_plus_plus/writer/open_document.rb,
lib/csv_plus_plus/writer/google_sheet_builder.rb
Overview
Various strategies for writing to various formats (excel, google sheets, CSV, OpenDocument)
Defined Under Namespace
Classes: BaseWriter, CSV, Excel, GoogleSheetBuilder, GoogleSheets, OpenDocument
Class Method Summary collapse
-
.writer(options) ⇒ Object
Return an instance of a writer depending on the given
options
.
Class Method Details
.writer(options) ⇒ Object
Return an instance of a writer depending on the given options
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/csv_plus_plus/writer.rb', line 14 def self.writer() return ::CSVPlusPlus::Writer::GoogleSheets.new() if .google case .output_filename when /\.csv$/ then ::CSVPlusPlus::Writer::CSV.new() when /\.ods$/ then ::CSVPlusPlus::Writer::OpenDocument.new() when /\.xls$/ then ::CSVPlusPlus::Writer::Excel.new() else raise(::StandardError, "Unsupported extension: #{.output_filename}") end end |