| 1 | package EPL2::Command::B; | ||
| 2 | # ABSTRACT: B Command (Bar code) | ||
| 3 | 3 | $EPL2::Command::B::VERSION = '0.001'; | |
| 4 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 3 | ▶ | use MooseX::Method::Signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 3 | ▶ | use EPL2::Types ( 'Natural', 'Rotation', 'Human', 'Barcode', 'Text' ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 3 | extends 'EPL2::Command'; | |
| 11 | |||
| 12 | #Public Attributes | ||
| 13 | 3 | has h_pos => ( is => 'rw', isa => Natural, default => 0 ); | |
| 14 | 3 | has v_pos => ( is => 'rw', isa => Natural, default => 0 ); | |
| 15 | 3 | has rotation => ( is => 'rw', isa => Rotation, default => 0 ); | |
| 16 | 3 | has barcode => ( is => 'rw', isa => Barcode, default => 3 ); | |
| 17 | 3 | has narrow_bar => ( is => 'rw', isa => Natural, default => 3 ); | |
| 18 | 3 | has wide_bar => ( is => 'rw', isa => Natural, default => 7 ); | |
| 19 | 3 | has height => ( is => 'rw', isa => Natural, default => 20 ); | |
| 20 | 3 | has human => ( is => 'rw', isa => Human, default => 'N' ); | |
| 21 | 3 | has text => ( is => 'ro', isa => Text, required => 1 ); | |
| 22 | |||
| 23 | #Methods | ||
| 24 | 3 | ▶ | method string ( Str :$delimiter = "\n" ) { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 25 | 1 | sprintf 'B%d,%d,%d,%s,%d,%d,%d,%s,%s%s', | |
| 26 | $self->h_pos, $self->v_pos, $self->rotation, $self->barcode, $self->narrow_bar, | ||
| 27 | $self->wide_bar, $self->height, $self->human, $self->text, $delimiter; | ||
| 28 | 3 | } | |
| 29 | |||
| 30 | 3 | __PACKAGE__->meta->make_immutable; | |
| 31 | |||
| 32 | 3 | 1; | |
| 33 | |||
| 34 | __END__ | ||