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
45 46 47 |
# File 'lib/jekyll-database-tables/formatters.rb', line 45 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.
35 36 37 |
# File 'lib/jekyll-database-tables/formatters.rb', line 35 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.
54 55 56 |
# File 'lib/jekyll-database-tables/formatters.rb', line 54 def separator(widths) raise NotImplementedError, "#{self.class} must implement #separator" end |