Class: WordpRSS::Feed
- Inherits:
-
Object
- Object
- WordpRSS::Feed
- Defined in:
- lib/wordprss/feed.rb
Instance Method Summary collapse
-
#description ⇒ String
Returns the RSS feed description.
-
#initialize(body) ⇒ Feed
constructor
A new instance of Feed.
-
#items ⇒ Array<WordpRSS::Item>
Returns a collection of the RSS feed items.
-
#title ⇒ String
Returns the RSS feed title.
Constructor Details
#initialize(body) ⇒ Feed
Returns a new instance of Feed.
6 7 8 |
# File 'lib/wordprss/feed.rb', line 6 def initialize(body) @body = body end |
Instance Method Details
#description ⇒ String
Returns the RSS feed description
20 21 22 |
# File 'lib/wordprss/feed.rb', line 20 def description xml.xpath("//channel").at("description").text end |
#items ⇒ Array<WordpRSS::Item>
Returns a collection of the RSS feed items
27 28 29 30 31 |
# File 'lib/wordprss/feed.rb', line 27 def items xml.css("item").map do |node| ::WordpRSS::Item.new(node) end end |
#title ⇒ String
Returns the RSS feed title
13 14 15 |
# File 'lib/wordprss/feed.rb', line 13 def title xml.xpath("//channel").at("title").text end |