NAME
Angerwhale::View::Feed - Common class that abstracts a "feed" of some sort
DESCRIPTION
This class serializes Angerwhale::ContentItem
s, presumably to generate an RSS or YAML feed.
Here's what this class knows how to deal with:
- A single
Item
-
If we get a single article or comment, we get the tree of children, flatten it, and return the result as an array of serialized items.
- Multiple
Article
s -
If we get multiple articles, then we assume we're doing the main 'RSS feed', and return a list of those articles serialized without children.
METHODS
prepare_items
Takes the stash and outputs an array of "items" that go in the feed. It's then up to the subclass to turn that into something readable
serialize_item($item, $recursive?)
Serialize $item by converting it into a hashref. Normally Articles/Comments are lazy loaded, but this forces everything to be evaluated and added to a hashref.
Attributes in the retured hashref are: title, type, summary, signed, xhtml, text, raw, guid, uri, date (Created), modified, tags, categories
the article is in (if possible), and an arrayref of comments
(if $recursive).
TODO: make this automatic.
time2str
Format times as per Atom spec
AUTHOR
Jonathan Rockway