Class: Prawnto::TemplateHandlers::Base

Inherits:
ActionView::TemplateHandler
  • Object
show all
Includes:
ActionView::TemplateHandlers::Compilable
Defined in:
lib/prawnto/template_handlers/base.rb

Direct Known Subclasses

Dsl, Raw

Instance Method Summary (collapse)

Instance Method Details

- (Object) compile(template)



6
7
8
9
10
11
# File 'lib/prawnto/template_handlers/base.rb', line 6

def compile(template)
  "_prawnto_compile_setup;" +
  "pdf = Prawn::Document.new(@prawnto_options[:prawn]);" + 
  "#{template.source}\n" +
  "pdf.render;"
end