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