class RSSFeed::RSSChannelItem

Attributes

node[R]

Public Class Methods

new(node) click to toggle source
# File lib/rss_feed/rss_channel_item.rb, line 6
def initialize(node)
  @node = node
end

Public Instance Methods

author() click to toggle source

Email address of the author (optional).

# File lib/rss_feed/rss_channel_item.rb, line 26
def author
  @node.at_xpath("author").try(:content)
end
categories() click to toggle source

Array of categories (optional).

# File lib/rss_feed/rss_channel_item.rb, line 31
def categories
  if nodes = @node.xpath("category")
    nodes.map { |node| RSSCategory.new(node) }
  end
end
comments() click to toggle source

Array of URLs to comments (optional).

# File lib/rss_feed/rss_channel_item.rb, line 38
def comments
  if nodes = @node.xpath("comments")
    nodes.map { |node| node.content }.compact
  end
end
description() click to toggle source

Description (required).

# File lib/rss_feed/rss_channel_item.rb, line 21
def description
  @node.at_xpath("description").content
end
enclosure() click to toggle source

Enclosure (optional).

# File lib/rss_feed/rss_channel_item.rb, line 45
def enclosure
  if node = @node.at_xpath("enclosure")
    RSSEnclosure.new(node)
  end
end
guid() click to toggle source

GUID (optional).

# File lib/rss_feed/rss_channel_item.rb, line 52
def guid
  if node = @node.at_xpath("guid")
    RSSGuid.new(node)
  end
end
pub_date() click to toggle source

Publication date (optional).

# File lib/rss_feed/rss_channel_item.rb, line 59
def pub_date
  if date = @node.at_xpath("pubDate").try(:content)
    Time.rfc822(date)
  end
end
source() click to toggle source

Source (optional).

# File lib/rss_feed/rss_channel_item.rb, line 66
def source
  if node = @node.at_xpath("source")
    RSSSource.new(node)
  end
end
title() click to toggle source

Title (required).

# File lib/rss_feed/rss_channel_item.rb, line 11
def title
  @node.at_xpath("title").content
end