Class: BreezyPDF::HTML::Strip
- Inherits:
-
Object
- Object
- BreezyPDF::HTML::Strip
- Defined in:
- lib/breezy_pdf/html/strip.rb
Overview
Replace assets with uploaded URL’s
Instance Method Summary collapse
-
#initialize(html_fragment) ⇒ Strip
constructor
A new instance of Strip.
- #stripped_fragment ⇒ Object
- #timing ⇒ Object
Constructor Details
#initialize(html_fragment) ⇒ Strip
Returns a new instance of Strip.
6 7 8 9 |
# File 'lib/breezy_pdf/html/strip.rb', line 6 def initialize(html_fragment) @html_fragment = html_fragment @start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) end |
Instance Method Details
#stripped_fragment ⇒ Object
11 12 13 14 15 16 |
# File 'lib/breezy_pdf/html/strip.rb', line 11 def stripped_fragment @stripped_fragment ||= parsed_document.tap do strip! BreezyPDF.logger.info("[BreezyPDF] Stripped out elements in `#{timing} seconds`") end.to_html end |
#timing ⇒ Object
18 19 20 |
# File 'lib/breezy_pdf/html/strip.rb', line 18 def timing @timing ||= Process.clock_gettime(Process::CLOCK_MONOTONIC) - @start_time end |