Module: Exportable::ExportMethods

Includes:
CsvExporter, XlsExporter, XmlExporter
Defined in:
lib/exportable/export_methods.rb,
lib/exportable/export_methods/csv_exporter.rb,
lib/exportable/export_methods/xls_exporter.rb,
lib/exportable/export_methods/xml_exporter.rb

Overview

This module serves as a container for export modules

Defined Under Namespace

Modules: CsvExporter, XlsExporter, XmlExporter

Instance Method Summary collapse

Methods included from XmlExporter

#export_xml

Methods included from Utils

#get_export_options

Methods included from XlsExporter

#export_xls

Methods included from CsvExporter

#export_csv

Instance Method Details

#export(format, options = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/exportable/export_methods.rb', line 8

def export(format, options = {})
  unless Exportable.formats.include?(format.to_sym)
    raise ArgumentError, "Unsupported output format '#{format}'"
  end
  send("export_#{format}", options)
end