Sha256: bfaf0c27a906f53598618d49e29c27612a613b490e25a6f51f62a2492bbb9c7d

Contents?: true

Size: 411 Bytes

Versions: 6

Compression:

Stored size: 411 Bytes

Contents

module PrawnCocktail
  class Template
    def initialize(name)
      @name = name
    end

    def apply(context)
      context.instance_eval(read_template, template_path)
    end

    private

    def read_template
      File.read(template_path)
    end

    def template_path
      File.join(template_root, "#{@name}.pdf.rb")
    end

    def template_root
      PrawnCocktail.template_root
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
prawn_cocktail-0.8.1 lib/prawn_cocktail/template.rb
prawn_cocktail-0.7.1 lib/prawn_cocktail/template.rb
prawn_cocktail-0.7.0 lib/prawn_cocktail/template.rb
prawn_cocktail-0.6.0 lib/prawn_cocktail/template.rb
prawn_cocktail-0.5.4 lib/prawn_cocktail/template.rb
prawn_cocktail-0.5.3 lib/prawn_cocktail/template.rb