Class: Html2rss::ItemExtractors::Html
- Inherits:
-
Object
- Object
- Html2rss::ItemExtractors::Html
- Defined in:
- lib/html2rss/item_extractors/html.rb
Overview
Return the HTML of the attribute.
Imagine this HTML structure:
<p>Lorem <b>ipsum</b> dolor ...</p>
YAML usage example:
selectors:
description:
selector: p
extractor: html
Would return:
'<p>Lorem <b>ipsum</b> dolor ...</p>'
Always make sure to sanitize the HTML during post processing with AttributePostProcessors::SanitizeHtml.
Instance Method Summary collapse
- #get ⇒ String
-
#initialize(xml, options) ⇒ Html
constructor
A new instance of Html.
Constructor Details
#initialize(xml, options) ⇒ Html
Returns a new instance of Html
23 24 25 |
# File 'lib/html2rss/item_extractors/html.rb', line 23 def initialize(xml, ) @element = ItemExtractors.element(xml, ) end |
Instance Method Details
#get ⇒ String
29 30 31 |
# File 'lib/html2rss/item_extractors/html.rb', line 29 def get @element.to_s end |