Net::Google::PicasaWeb::MediaFeed - base class for media feed entries


Net-Google-PicasaWeb documentation Contained in the Net-Google-PicasaWeb distribution.

Index


Code Index:

NAME

Top

Net::Google::PicasaWeb::MediaFeed - base class for media feed entries

VERSION

Top

version 0.11

DESCRIPTION

Top

Provides some common functions for the media-based objects (the ones with photo/video links). This class extends Net::Google::PicasaWeb::Feed.

ATTRIBUTES

Top

photo

This is the photo for the media feed object. This returns a Net::Google::Picasa::Media.

AUTHOR

Top

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Top


Net-Google-PicasaWeb documentation Contained in the Net-Google-PicasaWeb distribution.

package Net::Google::PicasaWeb::MediaFeed;
BEGIN {
  $Net::Google::PicasaWeb::MediaFeed::VERSION = '0.11';
}
use Moose;

extends 'Net::Google::PicasaWeb::Feed';

# ABSTRACT: base class for media feed entries


has photo => (
    is          => 'rw',
    isa         => 'Net::Google::PicasaWeb::Media',
);

override from_feed => sub {
    my ($class, $service, $entry) = @_;
    my $self = $class->super($service, $entry);

    if ($entry->has_child('media:group')) {
        my $media = Net::Google::PicasaWeb::Media->from_feed(
            $self->service, $entry->first_child('media:group')
        );
        $self->photo($media);
    }

    return $self;
};

__PACKAGE__->meta->make_immutable;

1;

__END__