Class: Pixelpress::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/pixelpress/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html, renderer, options = {}) ⇒ Document

Returns a new instance of Document.



8
9
10
11
12
# File 'lib/pixelpress/document.rb', line 8

def initialize(html, renderer, options = {})
  @html = html
  @renderer = renderer
  @file_name = options[:file_name]
end

Instance Attribute Details

#file_nameObject (readonly)

Returns the value of attribute file_name.



6
7
8
# File 'lib/pixelpress/document.rb', line 6

def file_name
  @file_name
end

#htmlObject (readonly)

Returns the value of attribute html.



5
6
7
# File 'lib/pixelpress/document.rb', line 5

def html
  @html
end

Instance Method Details

#pdfObject



14
15
16
# File 'lib/pixelpress/document.rb', line 14

def pdf
  FakeFile.new pdf_data, original_filename: file_name
end