Class: Prawnto::TemplateHandlers::Base

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

Direct Known Subclasses

Dsl, Raw

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(template) ⇒ Object



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

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

Instance Method Details

#compile(template) ⇒ Object



16
17
18
# File 'lib/prawnto/template_handlers/base.rb', line 16

def compile(template)
  self.class.call(template)
end