Class: Passcard::HtmlOutputter
- Defined in:
- lib/passcard/outputter/html_outputter.rb
Constant Summary
Constants inherited from Outputter
Instance Attribute Summary
Attributes inherited from Outputter
Instance Method Summary collapse
Methods inherited from Outputter
#col_headers, #data_in, #get_grid, #initialize, register, #row_headers, #use_palette
Constructor Details
This class inherits a constructor from Passcard::Outputter
Instance Method Details
#to_html(options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/passcard/outputter/html_outputter.rb', line 5 def to_html( = {}) html = "" get_grid() use_palette [:color] html += get_col_headers if [:header] grid.row_size.times.map do |i| html += "<div class='row'>" html += get_row_header(i) if [:header] html += get_row(i, [:color]) html += "</div>" end data = data_in(__FILE__).gsub('{{GRID}}', html) data = data.gsub('{{BACKGROUND}}', get_background) if [:color] data end |