Conveyor/Transaction.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 54.5% 6 / 11 Podpod 100% 5 / 5 totaltotal 68.2% 28 / 41 CC 1 SCAR 3.1
CC
1
Cov
68%
payload_item
2.0
payload_item_data
2.0
record
2.0
CRAP 1.4
« Conveyor/Ticket/Payload/BusinessObject.pm ↑ Summary Conveyor/Ticket/Dispatcher/Test.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Conveyor::Transaction;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Data::Conveyor::Transaction::VERSION = '1.103130';
8 }
9 # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
10  
11 # Base class for classes operating on transactions. Policy and delegation
12 # classes subclass this class.
13 1 ▶use Error::Hierarchy::Util 'assert_defined';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use parent 'Class::Scaffold::Storable';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 __PACKAGE__->mk_framework_object_accessors(
16 ticket => 'ticket',
17 transaction_factory => 'factory',
18 )->mk_scalar_accessors(qw(tx stage))->mk_array_accessors(qw(extra_tx_list));
19  
20 # ticket and tx are passed by Data::Conveyor::Transaction::Factory
21 # constructor call; the factory also passes itself as the factory
22 # attribute so the transaction can ask the factory to construct
23 # further objects.
24 # shortcuts to the item and its data referenced by the current transaction
25 0 ▶sub payload_item { $_[0]->tx->transaction->payload_item }
Subroutine payload_item: not called CC=1 SCAR=6.9
Pod documented
26 0 ▶sub payload_item_data { $_[0]->payload_item->data }
Subroutine payload_item_data: not called CC=1 SCAR=6.9
Pod documented
27  
28 # Cumulate exceptions here and throw them summarily in an exception container
29 # at the end. We do this because we want to be able to check as much as
30 # possible.
31 0 ▶sub record {
Subroutine record: not called CC=1 SCAR=6.9
Pod documented
32 0 my $self = shift;
33  
34 # make record() invisible to caller when reporting exception location
35 0 local $Error::Depth = $Error::Depth + 1;
36 0 $self->payload_item->exception_container->record(@_,
37 is_optional => $self->tx->transaction->is_optional,);
38 }
39  
40 # Like record(), but records an actual exception object. This method would be
41 # called if you want to record an exception caught from somewhere else.
42 0 ▶sub record_exception {
Subroutine record_exception: not called CC=1 SCAR=6.9
Pod documented
43 0 my ($self, $E) = @_;
44 0 $E->is_optional($self->tx->transaction->is_optional);
45 0 $self->payload_item->exception_container->items_set_push($E);
46 }
47 0 ▶sub run { }
Subroutine run: not called CC=1 SCAR=0.0
Pod documented
48 1 1;
49  
50  
51 __END__
« Conveyor/Ticket/Payload/BusinessObject.pm ↑ Summary Conveyor/Ticket/Dispatcher/Test.pm »