| 1 | package EPL2::Command::P; | ||||||||||||||
| 2 | # ABSTRACT: P Command (Print) | ||||||||||||||
| 3 | 2 | $EPL2::Command::P::VERSION = '0.001'; | |||||||||||||
| 4 | 3 | ▶ | use 5.010; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 3 | ▶ | use Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 3 | ▶ | use MooseX::Method::Signatures; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 3 | ▶ | use namespace::autoclean; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | 3 | ▶ | use EPL2::Types qw(Positive Natural); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | |||||||||||||||
| 10 | 2 | extends 'EPL2::Command'; | |||||||||||||
| 11 | |||||||||||||||
| 12 | #Public Attributes | ||||||||||||||
| 13 | 2 | has number_sets => ( is => 'rw', isa => Positive, default => 1, ); | |||||||||||||
| 14 | 2 | has number_copies => ( is => 'rw', isa => Natural, default => 0, ); | |||||||||||||
| 15 | |||||||||||||||
| 16 | #Methods | ||||||||||||||
| 17 | 3 | ▶ | method string ( Str :$delimiter = "\n" ) { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=2 SCAR=7.0
Subroutine
string: called CC=2 SCAR=7.0
| |||||||||||||||
| 18 | 1 | my $string = sprintf 'P%d', $self->number_sets; | |||||||||||||
| 19 | 1 | ▶ | $string .= ',' . $self->number_copies if ( $self->number_copies ); | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 20 | 1 | return $string . $delimiter; | |||||||||||||
| 21 | 2 | } | |||||||||||||
| 22 | |||||||||||||||
| 23 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||||||
| 24 | |||||||||||||||
| 25 | 2 | 1; | |||||||||||||
| 26 | |||||||||||||||
| 27 | __END__ | ||||||||||||||