package MooseX::JobControl::JobQueue::Array;
use Moose;
use MooseX::AttributeHelpers;
use Moose::Util::TypeConstraints;

has jobs => (
    metaclass  => 'Collection::Array',
    isa        => 'ArrayOfJobs',
    is         => 'rw',
    default    => sub { [] },
    coerce     => 1,
    auto_deref => 1,
    provides   => {
        push    => 'add_job',
        pop     => 'remove_last_job',
        shift   => 'next_job',
        unshift => 'add_next_job',
        count   => 'has_jobs',
    }
);

# Note you have to put the Role stuff down here so the delegated methods
# in the Attribute above exist when Moose checks for them

with qw( MooseX::JobControl::Interface::JobQueue);

no Moose;
