Class Ruport::Formatter::HTML
In: lib/ruport/formatter/html.rb
Parent: Formatter

This class produces HTML output for Ruport‘s Row, Table, Group, and Grouping renderers. It can be subclassed, as it has some helper methods that might be useful for custom output.

Rendering Options

:show_table_headers True by default

:show_group_headers True by default

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

Methods

Public Instance methods

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

Creates the group body. Since group data is a table, just uses the Table renderer.

Renders the header for a group using the group name.

Generates the body for a grouping. Iterates through the groups and renders them using the group renderer.

Renders individual rows for the table.

Uses the Row renderer to build up the table body. Replaces nil and empty strings with " "

Simply closes the table tag.

Generates table headers based on the column names of your Data::Table.

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

Generates <table> tags enclosing the yielded content.

Example:

  output << html_table { "<tr><td>1</td><td>2</td></tr>\n" }
  #=> "<table>\n<tr><td>1</td><td>2</td></tr>\n</table>\n"

Uses RedCloth to turn a string containing textile markup into HTML.

Example:

  textile "*bar*" #=> "<p><strong>foo</strong></p>"

[Validate]