Class: QueryReport::ReportPdf
- Inherits:
-
Object
- Object
- QueryReport::ReportPdf
- Defined in:
- lib/query_report/report_pdf.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
-
#initialize(report) ⇒ ReportPdf
constructor
A new instance of ReportPdf.
- #render_footer ⇒ Object
-
#render_header ⇒ Object
render the header from the template class.
- #to_pdf ⇒ Object
Constructor Details
#initialize(report) ⇒ ReportPdf
Returns a new instance of ReportPdf.
5 6 7 8 9 |
# File 'lib/query_report/report_pdf.rb', line 5 def initialize(report) @report = report @options = QueryReport.config. @pdf = Prawn::Document.new end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/query_report/report_pdf.rb', line 3 def @options end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
3 4 5 |
# File 'lib/query_report/report_pdf.rb', line 3 def pdf @pdf end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
3 4 5 |
# File 'lib/query_report/report_pdf.rb', line 3 def report @report end |
Instance Method Details
#render_footer ⇒ Object
16 17 18 |
# File 'lib/query_report/report_pdf.rb', line 16 def template.try(:render_footer) end |
#render_header ⇒ Object
render the header from the template class
12 13 14 |
# File 'lib/query_report/report_pdf.rb', line 12 def render_header template.try(:render_header) end |
#to_pdf ⇒ Object
20 21 22 23 24 |
# File 'lib/query_report/report_pdf.rb', line 20 def to_pdf render_charts_with report render_table_with report pdf end |