Class: YYFeed::Feed
- Inherits:
-
Object
- Object
- YYFeed::Feed
- Defined in:
- lib/YYFeed.rb
Overview
rss2.0 & rss1.0 & atom specs are integrated within this class.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize ⇒ Feed
constructor
A new instance of Feed.
- #link ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize ⇒ Feed
Returns a new instance of Feed.
20 21 22 23 |
# File 'lib/YYFeed.rb', line 20 def initialize @content = nil @items = Array.new end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
18 19 20 |
# File 'lib/YYFeed.rb', line 18 def content @content end |
#items ⇒ Object
Returns the value of attribute items.
18 19 20 |
# File 'lib/YYFeed.rb', line 18 def items @items end |
Instance Method Details
#description ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/YYFeed.rb', line 41 def description if @content.feed_type == "atom" return "" elsif @content.feed_type == "rss" return @content.channel.description end end |
#link ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/YYFeed.rb', line 33 def link if @content.feed_type == "atom" return @content.link.href elsif @content.feed_type == "rss" return @content.channel.link end end |
#title ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/YYFeed.rb', line 25 def title if @content.feed_type == "atom" return @content.title.content elsif @content.feed_type == "rss" return @content.channel.title end end |