Class: Prawnto::TemplateHandlers::Base
- Inherits:
-
Object
- Object
- Prawnto::TemplateHandlers::Base
- Includes:
- ActionView::TemplateHandlers::Compilable
- Defined in:
- lib/prawnto/template_handlers/base.rb
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 |