Class: Html2rss::Html::ArticleExtractor::DateExtractor
- Inherits:
-
Object
- Object
- Html2rss::Html::ArticleExtractor::DateExtractor
- Defined in:
- lib/html2rss/html/article_extractor/date_extractor.rb
Overview
Extracts the earliest date from an article_tag.
Class Method Summary collapse
Class Method Details
.call(article_tag) ⇒ DateTime?
10 11 12 13 |
# File 'lib/html2rss/html/article_extractor/date_extractor.rb', line 10 def self.call(article_tag) datetimes = article_tag.css('[datetime]').map { |tag| tag['datetime'] } ArticleRules::Date.earliest(datetimes) end |