Class: Jekyll::DatabaseTables::Formatter
- Inherits:
-
Object
- Object
- Jekyll::DatabaseTables::Formatter
- Defined in:
- lib/jekyll-database-tables/formatters.rb
Overview
Abstract base class for table formatters.
Subclasses must implement #render, #format_row, and #separator. Shared rendering utilities are available via Helpers.
Direct Known Subclasses
Defined Under Namespace
Modules: Helpers
Instance Method Summary collapse
-
#format_row(cells, widths) ⇒ String
Formats a single row of cells into a string.
-
#render(table, title: nil) ⇒ String
Renders a Table to a string.
-
#separator(widths) ⇒ String
Renders the separator line between headers and data rows.
Instance Method Details
#format_row(cells, widths) ⇒ String
Formats a single row of cells into a string
47 48 49 |
# File 'lib/jekyll-database-tables/formatters.rb', line 47 def format_row(cells, widths) raise NotImplementedError, "#{self.class} must implement #format_row" end |
#render(table, title: nil) ⇒ String
Renders a Table to a string.
37 38 39 |
# File 'lib/jekyll-database-tables/formatters.rb', line 37 def render(table, title: nil) raise NotImplementedError, "#{self.class} must implement #render" end |
#separator(widths) ⇒ String
Renders the separator line between headers and data rows.
56 57 58 |
# File 'lib/jekyll-database-tables/formatters.rb', line 56 def separator(widths) raise NotImplementedError, "#{self.class} must implement #separator" end |