| 1 | 2 | ▶ | use 5.008; |
|
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 Data::Conveyor::Ticket::Payload::Instruction; | ||
| 6 | 2 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | $Data::Conveyor::Ticket::Payload::Instruction::VERSION = '1.103130'; | |
| 8 | } | ||
| 9 | # ABSTRACT: Stage-based conveyor-belt-like ticket handling system | ||
| 10 | |||
| 11 | # ptags: DCTPI | ||
| 12 | 0 | ▶ | use Class::Value; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 13 | use parent 'Class::Scaffold::Storable'; | ||
| 14 | use overload | ||
| 15 | 'eq' => 'eq', | ||
| 16 | '""' => 'stringify'; | ||
| 17 | __PACKAGE__ | ||
| 18 | ->mk_scalar_accessors(qw(command)) | ||
| 19 | ->mk_object_accessors('Class::Value' => 'value'); | ||
| 20 | |||
| 21 | # Override type() in subclasses. Override value() as well; should be a value | ||
| 22 | # object corresponding to the type of instruction. | ||
| 23 | use constant type => ''; | ||
| 24 | |||
| 25 | sub eq { | ||
| 26 | my ($lhs, $rhs) = @_; | ||
| 27 | (sprintf "%s", $lhs) eq (sprintf "%s", $rhs); | ||
| 28 | } | ||
| 29 | |||
| 30 | sub stringify { | ||
| 31 | my $self = shift; | ||
| 32 | sprintf 'command [%s], type [%s], value [%s]', | ||
| 33 | $self->command, $self->type, $self->value; | ||
| 34 | } | ||
| 35 | |||
| 36 | sub check { | ||
| 37 | my ($self, $exception_container) = @_; | ||
| 38 | $self->value->run_checks_with_exception_container($exception_container); | ||
| 39 | } | ||
| 40 | 1; | ||
| 41 | |||
| 42 | |||
| 43 | __END__ | ||