Class: Thinreports::SectionReport::Generate
- Inherits:
-
Object
- Object
- Thinreports::SectionReport::Generate
- Defined in:
- lib/thinreports/section_report/generate.rb
Instance Method Summary collapse
- #call(report_params, filename: nil) ⇒ Object
-
#initialize ⇒ Generate
constructor
A new instance of Generate.
Constructor Details
#initialize ⇒ Generate
Returns a new instance of Generate.
9 10 11 |
# File 'lib/thinreports/section_report/generate.rb', line 9 def initialize @pdf = Thinreports::Generator::PDF::Document.new end |
Instance Method Details
#call(report_params, filename: nil) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/thinreports/section_report/generate.rb', line 13 def call(report_params, filename: nil) report = Build.new.call(report_params) PDF::Render.new(pdf).call!(report) filename ? pdf.render_file(filename) : pdf.render end |