Class: RSSable::Parsers::Channel
- Inherits:
-
Object
- Object
- RSSable::Parsers::Channel
- Defined in:
- lib/rssable/parsers/channel.rb
Instance Method Summary collapse
-
#description ⇒ String
Returns the RSS feed description.
-
#initialize(feed:, driver:) ⇒ Channel
constructor
A new instance of Channel.
-
#items ⇒ Array
Returns a collection of the RSS feed items.
-
#link ⇒ String
Returns the website link.
-
#title ⇒ String
Returns the RSS feed title.
Constructor Details
#initialize(feed:, driver:) ⇒ Channel
Returns a new instance of Channel.
5 6 7 8 |
# File 'lib/rssable/parsers/channel.rb', line 5 def initialize(feed:, driver:) @feed = feed @driver = driver end |
Instance Method Details
#description ⇒ String
Returns the RSS feed description
20 21 22 |
# File 'lib/rssable/parsers/channel.rb', line 20 def description xml.xpath("//channel").at("description").text end |
#items ⇒ Array
Returns a collection of the RSS feed items
34 35 36 |
# File 'lib/rssable/parsers/channel.rb', line 34 def items xml.css("item").map { |node| item_class.new(node) } end |
#link ⇒ String
Returns the website link
27 28 29 |
# File 'lib/rssable/parsers/channel.rb', line 27 def link xml.xpath("//channel").at("link").text end |
#title ⇒ String
Returns the RSS feed title
13 14 15 |
# File 'lib/rssable/parsers/channel.rb', line 13 def title xml.xpath("//channel").at("title").text end |