class Pixelpress::Document

Attributes

file_name[R]
html[R]
renderer[RW]

Public Class Methods

new(html, renderer, options = {}) click to toggle source
# File lib/pixelpress/document.rb, line 8
def initialize(html, renderer, options = {})
  @html = html
  @renderer = renderer
  @file_name = options[:file_name]
end

Public Instance Methods

pdf() click to toggle source
# File lib/pixelpress/document.rb, line 14
def pdf
  FakeFile.new pdf_data, original_filename: file_name
end

Private Instance Methods

pdf_data() click to toggle source
# File lib/pixelpress/document.rb, line 22
def pdf_data
  @pdf_data ||= renderer.render(html)
end