Class: FeedNormalizer::Feed
- Inherits:
-
Object
- Object
- FeedNormalizer::Feed
- Includes:
- ElementCleaner, ElementEquality, Singular, TimeFix
- Defined in:
- lib/structures.rb
Overview
Represents the root element of a feed. Available fields are:
* title
* description
* id
* last_updated
* copyright
* authors / author
* urls / url
* image
* generator
* items / channel
Constant Summary collapse
- HTML_ELEMENTS =
Elements that can contain HTML fragments.
[:title, :description]
- SIMPLE_ELEMENTS =
Elements that contain ‘plain’ Strings, with HTML escaped.
[:id, :last_updated, :copyright, :authors, :urls, :image, :generator, :ttl, :skip_hours, :skip_days]
- BLENDED_ELEMENTS =
Elements that contain both HTML and escaped HTML.
[:items]
- ELEMENTS =
HTML_ELEMENTS + SIMPLE_ELEMENTS + BLENDED_ELEMENTS
Instance Attribute Summary collapse
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #channel ⇒ Object
-
#initialize(wrapper) ⇒ Feed
constructor
A new instance of Feed.
- #last_updated ⇒ Object
Methods included from Singular
Methods included from ElementEquality
Methods included from ElementCleaner
Methods included from TimeFix
Constructor Details
#initialize(wrapper) ⇒ Feed
Returns a new instance of Feed.
224 225 226 227 228 229 230 231 232 233 |
# File 'lib/structures.rb', line 224 def initialize(wrapper) # set up associations (i.e. arrays where needed) @urls = [] @authors = [] @skip_hours = [] @skip_days = [] @items = [] @parser = wrapper.parser.to_s @last_updated = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FeedNormalizer::Singular
Instance Attribute Details
#parser ⇒ Object
Returns the value of attribute parser.
220 221 222 |
# File 'lib/structures.rb', line 220 def parser @parser end |
Instance Method Details
#channel ⇒ Object
240 |
# File 'lib/structures.rb', line 240 def channel() self end |
#last_updated ⇒ Object
236 237 238 |
# File 'lib/structures.rb', line 236 def last_updated @last_updated = reparse(@last_updated) end |