Files
adamantium/slices/main/views/feeds/rss.rb
2024-02-21 21:48:44 +11:00

26 lines
522 B
Ruby

require "builder"
module Main
module Views
module Feeds
class Rss < Main::View
include Deps["repos.post_repo"]
expose :posts do
post_repo.for_rss.map do |post|
(post.post_type == "bookmark") ?
Decorators::Bookmarks::Decorator.new(post) :
Decorators::Posts::Decorator.new(post)
end
end
expose :xml, decorate: false
def xml
Builder::XmlMarkup.new(indent: 2)
end
end
end
end
end