Class Ruport::Formatter::CSV
In: lib/ruport/formatter/csv.rb
Parent: Formatter

This formatter implements the CSV format for Ruport’s Row, Table, Group and Grouping controllers. It is a light wrapper around James Edward Gray II’s FasterCSV.

Rendering Options

:style Used for grouping (:inline,:justified,:raw)

:format_options A hash of FasterCSV options

:formatter An existing FasterCSV object to write to

:show_table_headers True by default

:show_group_headers True by default

Methods

Attributes

csv_writer  [W] 

Public Class methods

Public Instance methods

Hook for setting available options using a template. See the template documentation for the available options and their format.

Renders the group body - uses the table controller to generate the output.

Renders the header for a group using the group name.

Determines the proper style to use and renders the Grouping.

Generates a header for the grouping using the grouped_by column and the column names.

Produces CSV output for a data row.

Calls the row controller for each row in the Data::Table

Generates table header by turning column_names into a CSV row. Uses the row controller to generate the actual formatted output

This method does not do anything if options.show_table_headers is false or the Data::Table has no column names.

Returns the current FCSV object or creates a new one if it has not been set yet. Note that FCSV(sig) has a cache and returns the same FCSV object if writing to the same underlying output with the same options.

[Validate]