Class: FeedNormalizer::Entry
- Inherits:
-
Object
- Object
- FeedNormalizer::Entry
- Includes:
- ElementCleaner, ElementEquality, RewriteRelativeLinks, Singular, TimeFix
- Defined in:
- lib/structures.rb
Overview
Represents a feed item entry. Available fields are:
* content
* description
* title
* date_published
* urls / url
* id
* authors / author
* copyright
* categories
Constant Summary collapse
- HTML_ELEMENTS =
[:content, :description, :title]
- SIMPLE_ELEMENTS =
[:date_published, :urls, :id, :authors, :copyright, :categories, :last_updated, :enclosures]
- BLENDED_ELEMENTS =
[]
- ELEMENTS =
HTML_ELEMENTS + SIMPLE_ELEMENTS + BLENDED_ELEMENTS
Instance Method Summary collapse
- #content ⇒ Object
- #date_published ⇒ Object
-
#initialize ⇒ Entry
constructor
A new instance of Entry.
- #last_updated ⇒ Object
Methods included from Singular
Methods included from ElementEquality
Methods included from ElementCleaner
Methods included from TimeFix
Methods included from RewriteRelativeLinks
Constructor Details
#initialize ⇒ Entry
Returns a new instance of Entry.
185 186 187 188 189 190 191 |
# File 'lib/structures.rb', line 185 def initialize @urls = [] @authors = [] @categories = [] @enclosures = [] @date_published, @content, @last_updated = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FeedNormalizer::Singular
Instance Method Details
#content ⇒ Object
204 205 206 |
# File 'lib/structures.rb', line 204 def content @content = rewrite_relative_links(@content, url) end |
#date_published ⇒ Object
194 195 196 |
# File 'lib/structures.rb', line 194 def date_published @date_published = reparse(@date_published) end |
#last_updated ⇒ Object
199 200 201 |
# File 'lib/structures.rb', line 199 def last_updated @last_updated = reparse(@last_updated) end |