Class: Prawnto::TemplateHandlers::Dsl

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) compile(template)



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

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