Class: Html2rss::Html::FeedLink
- Inherits:
-
Data
- Object
- Data
- Html2rss::Html::FeedLink
- Defined in:
- lib/html2rss/html/feed_link.rb
Overview
A native RSS/Atom hint from a document head link[rel=alternate].
Does not guess /feed or /rss.xml paths — that stays in configs probe_rss.
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Class Method Summary collapse
-
.from_document(doc) ⇒ Array<FeedLink>
Collects RSS/Atom
rel=alternatelinks from +doc+'shead.
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href
8 9 10 |
# File 'lib/html2rss/html/feed_link.rb', line 8 def href @href end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type
8 9 10 |
# File 'lib/html2rss/html/feed_link.rb', line 8 def mime_type @mime_type end |
Class Method Details
.from_document(doc) ⇒ Array<FeedLink>
Collects RSS/Atom rel=alternate links from +doc+'s head.
15 16 17 |
# File 'lib/html2rss/html/feed_link.rb', line 15 def from_document(doc) doc.css('head link[rel~="alternate"][href]').filter_map { |node| from_node(node) } end |