Class: Hootenanny::Feed::RSSFeed
Constant Summary
FEED_TYPE_MAPPINGS
Instance Method Summary
collapse
#+, #-, #empty?, from_content, infer, #to_digest_feed, #type
Instance Method Details
#content ⇒ Object
28
29
30
|
# File 'lib/hootenanny/feed/rss_feed.rb', line 28
def content
@content
end
|
#content=(content) ⇒ Object
32
33
34
35
36
|
# File 'lib/hootenanny/feed/rss_feed.rb', line 32
def content=(content)
@content = coerce_content(content)
rescue RSS::Error => e
raise Hootenanny::Feed::ParseError.wrap(e)
end
|
#content_type ⇒ Object
13
14
15
|
# File 'lib/hootenanny/feed/rss_feed.rb', line 13
def content_type
'application/rss+xml'
end
|
#items ⇒ Object
9
10
11
|
# File 'lib/hootenanny/feed/rss_feed.rb', line 9
def items
@items ||= content.items.map { |i| Hootenanny::Feed::RSSFeedItem.new i }
end
|
#to_s ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/hootenanny/feed/rss_feed.rb', line 17
def to_s
@to_s ||= -> do
item_string = items.map { |item| item.content.to_s }.join('')
feed_string = content.to_s
feed_string.gsub!(%r{<item>.*</item>}m, item_string)
feed_string
end.call
end
|