Class: BreezyPDF::Resources::HTML
- Inherits:
-
Object
- Object
- BreezyPDF::Resources::HTML
- Defined in:
- lib/breezy_pdf/resources/html.rb
Overview
:nodoc
Instance Method Summary collapse
- #content_type ⇒ Object
- #file_path ⇒ Object
- #filename ⇒ Object
-
#initialize(base_url, html_fragment) ⇒ HTML
constructor
A new instance of HTML.
- #metadata ⇒ Object
- #upload_ids ⇒ Object
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_type ⇒ Object
12 13 14 |
# File 'lib/breezy_pdf/resources/html.rb', line 12 def content_type "text/html" end |
#file_path ⇒ Object
20 21 22 |
# File 'lib/breezy_pdf/resources/html.rb', line 20 def file_path file.path end |
#filename ⇒ Object
16 17 18 |
# File 'lib/breezy_pdf/resources/html.rb', line 16 def filename @filename ||= "#{SecureRandom.hex}.html" end |
#metadata ⇒ Object
24 25 26 |
# File 'lib/breezy_pdf/resources/html.rb', line 24 def @metadata ||= BreezyPDF. ? Hash[*] : {} end |
#upload_ids ⇒ Object
28 29 30 31 32 |
# File 'lib/breezy_pdf/resources/html.rb', line 28 def upload_ids modified_html_fragment @upload_ids end |