Gte ready for release
[catagits/XML-Feed.git] / lib / XML / Feed / Entry.pm
index 005a926..f2fadb2 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Entry.pm 1872 2005-08-12 04:28:42Z btrott $
+# $Id$
 
 package XML::Feed::Entry;
 use strict;
@@ -20,10 +20,10 @@ sub new {
     my $class = shift;
     my($format) = @_;
     $format ||= 'Atom';
-    my $format_class = 'XML::Feed::' . $format;
+    my $format_class = 'XML::Feed::Format::' . $format;
     eval "use $format_class";
     Carp::croak("Unsupported format $format: $@") if $@;
-    my $entry = bless {}, join('::', __PACKAGE__, $format);
+    my $entry = bless {}, join('::', __PACKAGE__, "Format", $format);
     $entry->init_empty or return $class->error($entry->errstr);
     $entry;
 }
@@ -54,6 +54,8 @@ sub issued;
 sub modified;
 sub lat;
 sub long;
+sub format;
+sub tags { shift->category(@_) }
 
 1;
 __END__
@@ -126,6 +128,16 @@ an I<XML::Feed::Content> object with an empty string in the I<body>.
 
 The category in which the entry was posted.
 
+Returns a list of categories if called in array context or the first
+category if called in scalar context.
+
+B<WARNING> It's possible this API might change to have an 
+I<add_category> instead.
+
+=head2 $entry->tags([ $tag ])
+
+A synonym for I<category>;
+
 =head2 $entry->author([ $author ])
 
 The name or email address of the person who posted the entry.
@@ -147,6 +159,14 @@ A I<DateTime> object representing the last-modified date of the entry.
 
 If present, I<$modified> should be a I<DateTime> object.
 
+=head2 $entry->wrap
+
+Take an entry in its native format and turn it into an I<XML::Feed::Entry> object.
+
+=head2 $entry->unwrap
+
+Take an I<XML::Feed::Entry> object and turn it into its native format.
+
 =head1 AUTHOR & COPYRIGHT
 
 Please see the I<XML::Feed> manpage for author, copyright, and license