App-Scrobble

 view release on metacpan or  search on metacpan

lib/App/Scrobble/Role/WithService.pm  view on Meta::CPAN

# ABSTRACT: Role interface for App::Scrobble::Service classes
package App::Scrobble::Role::WithService;

use Moose::Role;
use namespace::autoclean;

our $VERSION = '0.03'; # VERSION

has 'tracks' => (
    is => 'rw',
    isa => 'ArrayRef',
    default => sub { [] },
    traits  => ['Array'],
    handles => {
        add_track => 'push',
    }
);

has 'url' => (
    is => 'rw',
    isa => 'Str',
);

requires 'is_plugin_for';

requires 'get_tracks';

1;



=pod

=head1 NAME

App::Scrobble::Role::WithService - Role interface for App::Scrobble::Service classes

=head1 VERSION

version 0.03

=head1 DESCRIPTION

Interface for L<App::Scrobble::Service::*> plugins.

=head1 ATTRIBUTES

=head2 C<url>

The URL (Str) of the podcast/cloudcast/webpage/whatever to scrobble.

=head2 C<tracks>

Arrayref of track data in the form:

    { title => 'foo', artist => 'bar' }

=head1 METHODS

=head2 C<is_plugin_for>

Will be passed the URL to scrobble and should return a boolean indicating
whether this plugin can scrobble this URL.

=head2 C<get_tracks>



( run in 0.537 second using v1.01-cache-2.11-cpan-39bf76dae61 )