lostapathy/simple_report

View on GitHub
lib/templates/newclass.erb

Summary

Maintainability
Test Coverage
# frozen_string_literal: true

# Generated by simple_report
class TemplatedReport < SimpleReport::Base
  def build_report(data)
    @placeholder = nil # a placeholder to be replaced later

    template_path '<%= @template_path %>'
    skip_rows <%= @title_row %>
    skip_headings

    add_sheet '<%= @sheet %>', data do |sheet|
<% @columns.each do |column| %>
      # <%= column.name %><% if column.instructions.size > 0 %>
      # <%= column.instructions %><% end %>
      sheet.add_field('<%= column.column %>', value: @placeholder)
<% end %>
    end
  end
end