lib/nitro/builders/rss.rb in nitro-0.15.0 vs lib/nitro/builders/rss.rb in nitro-0.16.0
- old
+ new
@@ -1,14 +1,14 @@
# * George Moschovitis <gm@navel.gr>
-# (c) 2004-2005 Navel, all rights reserved.
-# $Id: rss.rb 266 2005-02-28 14:50:48Z gmosx $
+# (c) 2005 Navel, all rights reserved.
+# $Id: rss.rb 1 2005-04-11 11:04:30Z gmosx $
require 'rss/0.9'
require 'glue/string'
-module N
+module Nitro
# Build RSS represenations of ruby object collections.
# Utilize duck typing to grab the attributes to render.
# Add this mixin to you classes to support RSS rendering.
#
@@ -41,10 +41,10 @@
channel.link = c[:link] if c[:link]
for obj in objects
item = RSS::Rss::Channel::Item.new
item.title = obj.title if obj.respond_to?(:title)
- item.description = N::StringUtils.head(obj.body, 256) if obj.respond_to?(:body)
+ item.description = Glue::StringUtils.head(obj.body, 256) if obj.respond_to?(:body)
item.link = "#{c[:base]}/#{obj.view_uri}" if obj.respond_to?(:view_uri)
channel.items << item
end
rss = RSS::Rss.new '0.9'