| 1 | 2 | ▶ | use 5.008001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package Dancer::Plugin::Queue::Array; | ||||||||||
| 6 | # ABSTRACT: No abstract given for Dancer::Plugin::Queue::Array | ||||||||||
| 7 | 2 | our $VERSION = '0.002'; # VERSION | |||||||||
| 8 | |||||||||||
| 9 | # Dependencies | ||||||||||
| 10 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | with 'Dancer::Plugin::Queue::Role::Queue'; | |||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 2 | has name => ( | |||||||||
| 15 | is => 'ro', | ||||||||||
| 16 | required => 1, | ||||||||||
| 17 | ); | ||||||||||
| 18 | |||||||||||
| 19 | has _messages => ( | ||||||||||
| 20 | is => 'ro', | ||||||||||
| 21 | 1 | ▶ | default => sub { [] }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 2 | ); | |||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 1 | ▶ | sub add_msg { | ||||||||
|
Subroutine
add_msg: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 1 | my ( $self, $msg ) = @_; | |||||||||
| 27 | 1 | push @{ $self->_messages }, $msg; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | sub get_msg { | ||||||||
|
Subroutine
get_msg: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 32 | 1 | my ($self) = @_; | |||||||||
| 33 | 1 | my $msg = shift @{ $self->_messages }; | |||||||||
| 34 | 1 | ▶ | return wantarray ? ( $msg, $msg ) : $msg; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 1 | ▶ | sub remove_msg { | ||||||||
|
Subroutine
remove_msg: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 39 | 1 | my ( $self, $msg ) = @_; | |||||||||
| 40 | # XXX NOOP since 'get_msg' already removes it | ||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 2 | 1; | |||||||||
| 44 | |||||||||||
| 45 | |||||||||||
| 46 | # vim: ts=4 sts=4 sw=4 et: | ||||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||