Class: Pressman::Builders::PdfBuilder
- Defined in:
- lib/pressman/builders/pdf_builder.rb
Instance Attribute Summary collapse
-
#pdf_content ⇒ Object
Returns the value of attribute pdf_content.
Attributes inherited from Builder
Instance Method Summary collapse
-
#initialize ⇒ PdfBuilder
constructor
A new instance of PdfBuilder.
Methods inherited from Builder
Constructor Details
#initialize ⇒ PdfBuilder
Returns a new instance of PdfBuilder.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pressman/builders/pdf_builder.rb', line 7 def initialize File.delete("#{@@config['title']}.pdf") if File.exist?("#{@@config['title']}.pdf") @pdf_content = "" Dir.glob("*/*.textile") do |file| @filename = File.basename(file, ".textile") content @pdf_content += render("templates/default.#{extension}.erb") end pdf = PDFKit.new(render("templates/layout.#{extension}.erb")) pdf.to_file("#{@@config['title']}.pdf") end |
Instance Attribute Details
#pdf_content ⇒ Object
Returns the value of attribute pdf_content.
5 6 7 |
# File 'lib/pressman/builders/pdf_builder.rb', line 5 def pdf_content @pdf_content end |