Method: Html2rss::Item#enclosure
- Defined in:
- lib/html2rss/item.rb
permalink #enclosure ⇒ Enclosure
Retrieves enclosure details for the item.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/html2rss/item.rb', line 136 def enclosure url = enclosure_url raise 'An item.enclosure requires an absolute URL' unless url&.absolute? type = config.selector_attributes_with_channel(:enclosure)[:content_type] || Html2rss::Utils.guess_content_type_from_url(url) Enclosure.new( type:, bits_length: 0, url: url.to_s ) end |