First cut at enclosures
[catagits/XML-Feed.git] / lib / XML / Feed / Enclosure.pm
CommitLineData
aa2dcd5c 1package XML::Feed::Enclosure;
2use strict;
3
4use strict;
5
6use base qw( Class::ErrorHandler );
7
8sub wrap {
9 my $class = shift;
10 my($c) = @_;
11 bless { %$c }, $class;
12}
13*new = \&wrap;
14
15sub _var {
16 my $enclosure = shift;
17 my $var = shift;
18 $enclosure->{$var} = shift if @_;
19 $enclosure->{$var};
20}
21
22sub type { shift->_var('type', @_) }
23sub length { shift->_var('length', @_) }
24sub url { shift->_var('url', @_) }
25
261;
27__END__
28
29=head1 NAME
30
31XML::Feed::Enclosure - Wrapper for enclosure objects
32
33=head1 SYNOPSIS
34
12a4079f 35 my ($enclosure) = $entry->enclosure;
aa2dcd5c 36 print $enclosure->type;
37
38=head1 DESCRIPTION
39
40I<XML::Feed::Enclosure> represents a content object in an I<XML::Feed::Entry>
41entry in a syndication feed.
42
43=head1 USAGE
44
45=head2 wrap
46
47Take params and turn them into a I<XML::Feed::Enclosure> object.
48
49=head2 new
50
51A synonym for I<wrap>.
52
53=head2 $enclosure->url
54
55The url of the object.
56
57=head2 $enclosure->type
58
59The MIME type of the item referred to in I<url>.
60
61=head2 $enclosure->length
62
63The length of object refereed to in I<url>
64
65=head1 AUTHOR & COPYRIGHT
66
67Please see the I<XML::Feed> manpage for author, copyright, and license
68information.
69
70=cut
71