Sha256: 5f1befd75b087aa19ef7492e0375554c9594d07632b8854481386d3a7a996080
Contents?: true
Size: 420 Bytes
Versions: 2
Compression:
Stored size: 420 Bytes
Contents
require 'action_view/template' require 'pdfcraft/document' module Pdfcraft class PdfHandler def call(template) "def #{Pdfcraft.variable_name};" + "@#{Pdfcraft.variable_name} ||= ::Pdfcraft::Document.new;" + "end;" + template.source + ";" + "#{Pdfcraft.variable_name}.render;" end end end ActionView::Template.register_template_handler :pdfcraft, Pdfcraft::PdfHandler.new
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pdfcraft-1.0.1 | lib/pdfcraft/pdf_template_handler.rb |
pdfcraft-1.0.0 | lib/pdfcraft/pdf_template_handler.rb |