Class: RSSable::Parsers::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/rssable/parsers/channel.rb

Instance Method Summary collapse

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

#descriptionString

Returns the RSS feed description

Returns:

  • (String)


20
21
22
# File 'lib/rssable/parsers/channel.rb', line 20

def description
  xml.xpath("//channel").at("description").text
end

#itemsArray

Returns a collection of the RSS feed items

Returns:

  • (Array)


34
35
36
# File 'lib/rssable/parsers/channel.rb', line 34

def items
  xml.css("item").map { |node| item_class.new(node) }
end

Returns the website link

Returns:

  • (String)


27
28
29
# File 'lib/rssable/parsers/channel.rb', line 27

def link
  xml.xpath("//channel").at("link").text
end

#titleString

Returns the RSS feed title

Returns:

  • (String)


13
14
15
# File 'lib/rssable/parsers/channel.rb', line 13

def title
  xml.xpath("//channel").at("title").text
end