Class: Html2rss::Html::Rendering::AudioRenderer
- Inherits:
-
Object
- Object
- Html2rss::Html::Rendering::AudioRenderer
- Defined in:
- lib/html2rss/html/rendering/audio_renderer.rb
Overview
Renders an HTML
Instance Method Summary collapse
-
#initialize(url:, type:) ⇒ AudioRenderer
constructor
A new instance of AudioRenderer.
-
#to_html ⇒ String
HTML audio snippet for article rendering.
Constructor Details
#initialize(url:, type:) ⇒ AudioRenderer
Returns a new instance of AudioRenderer.
12 13 14 15 |
# File 'lib/html2rss/html/rendering/audio_renderer.rb', line 12 def initialize(url:, type:) @url = url @type = type end |
Instance Method Details
#to_html ⇒ String
Returns HTML audio snippet for article rendering.
18 19 20 21 22 23 24 |
# File 'lib/html2rss/html/rendering/audio_renderer.rb', line 18 def to_html [ '<audio controls preload="none" referrerpolicy="no-referrer" crossorigin="anonymous">', %(<source src="#{escaped_url}" type="#{escaped_type}">), '</audio>' ].join end |