Class: Prawnto::TemplateHandlers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/prawnto/template_handlers/base.rb

Class Method Summary collapse

Class Method Details

.call(template, source = nil) ⇒ Object



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

def self.call(template, source = nil)
  source ||= template.source
  check_for_pdf_redefine(source)

  "_prawnto_compile_setup;" +
  "renderer = Prawnto::TemplateHandlers::Renderer.new(self);"+
  "renderer.to_pdf(self) do; #{source}\nend;"
end