Class: Prawnto::TemplateHandlers::Dsl

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

Class Method Summary collapse

Methods inherited from Base

#compile

Class Method Details

.call(template) ⇒ Object



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

def self.call(template)
  <<-RUBY
    _prawnto_compile_setup(true)
    pdf = Prawn::Document.new(@prawnto_options[:prawn])
    pdf.instance_eval do
      #{template.source}
    end
    pdf.render
  RUBY
end