Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BaseReport < Pdf
- def initialize(report)
- @report = report
- end
- def build
- create_header
- create_table
- create_footer
- end
- def create_header
- text @report.title
- text @report.date
- end
- def create_table
- table_rows = [@report.header_row] + @report.data_rows + [@report.footer_row]
- table table_rows, width: table_width
- end
- def footer
- text @report.summary
- end
- def table_width
- 500
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement