Class: BreezyPDF::Resources::HTML

Inherits:
Object
  • Object
show all
Defined in:
lib/breezy_pdf/resources/html.rb

Overview

:nodoc

Instance Method Summary collapse

Constructor Details

#initialize(base_url, html_fragment) ⇒ HTML

Returns a new instance of HTML.



6
7
8
9
10
# File 'lib/breezy_pdf/resources/html.rb', line 6

def initialize(base_url, html_fragment)
  @base_url      = base_url
  @html_fragment = html_fragment
  @upload_ids    = []
end

Instance Method Details

#content_typeObject



12
13
14
# File 'lib/breezy_pdf/resources/html.rb', line 12

def content_type
  "text/html"
end

#file_pathObject



20
21
22
# File 'lib/breezy_pdf/resources/html.rb', line 20

def file_path
  file.path
end

#filenameObject



16
17
18
# File 'lib/breezy_pdf/resources/html.rb', line 16

def filename
  @filename ||= "#{SecureRandom.hex}.html"
end

#metadataObject



24
25
26
# File 'lib/breezy_pdf/resources/html.rb', line 24

def 
  @metadata ||= BreezyPDF. ? Hash[*meta_tags] : {}
end

#upload_idsObject



28
29
30
31
32
# File 'lib/breezy_pdf/resources/html.rb', line 28

def upload_ids
  modified_html_fragment

  @upload_ids
end