AuditAny/AuditContext/Column.pm

filter: Statementstmt 67.7% 21 / 31 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod 100% 1 / 1 totaltotal 58.7% 27 / 46 CC 3 SCAR 7.6
CC
3
Cov
60%
__ANON__
3.7
__ANON__
3.7
class
2.0
CRAP 2.1
« AuditAny/Util/SchemaMaker.pm ↑ Summary AuditAny/DataPoint.pm »
1 package DBIx::Class::AuditAny::AuditContext::Column;
2 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Default 'Column' context object class for DBIx::Class::AuditAny
6  
7 =head1 NAME
8  
9 DBIx::Class::AuditAny::AuditContext::Column - Default 'Column' context object for DBIx::Class::AuditAny
10  
11 =head1 DESCRIPTION
12  
13 This class tracks a single change to a single column, belonging to a parent "Change" context which
14 represents multiple column changes, and the Change may belong to a "ChangeSet" which may comprise
15 multiple different Changes, which of which having 1 or more column change contexts.
16  
17 =cut
18  
19 14 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 14 ▶use MooX::Types::MooseLike::Base qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
21 14 extends 'DBIx::Class::AuditAny::AuditContext';
22  
23 14 ▶use DBIx::Class::AuditAny::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 =head1 ATTRIBUTES
26  
27 Docs regarding the API/purpose of the attributes and methods in this class still TBD...
28  
29 =head2 ChangeContext
30  
31 =head2 column_name
32  
33 =head2 old_value
34  
35 =head2 new_value
36  
37 =cut
38  
39 14 has 'ChangeContext', is => 'ro', required => 1;
40 14 has 'column_name', is => 'ro', isa => Str, required => 1;
41 0 ▶has 'old_value', is => 'ro', isa => Maybe[Str], coerce => sub { $_[0] ? "$_[0]" : $_[0] }, required => 1;
Subroutine __ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 0 0 0
42 0 ▶has 'new_value', is => 'ro', isa => Maybe[Str], coerce => sub { $_[0] ? "$_[0]" : $_[0] }, required => 1;
Subroutine __ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 0 0 0
43  
44 =head1 METHODS
45  
46 =head2 class
47  
48 =cut
49 0 ▶sub class { (shift)->ChangeContext->class }
Subroutine class: not called CC=1 SCAR=6.9
Pod documented
50  
51 0 ▶sub _build_tiedContexts {
Subroutine _build_tiedContexts: not called CC=1 SCAR=6.9
52 0 my $self = shift;
53 0 my @Contexts = ( $self->ChangeContext, @{$self->ChangeContext->tiedContexts} );
54 0 return \@Contexts;
55 }
56 0 ▶sub _build_local_datapoint_data {
Subroutine _build_local_datapoint_data: not called CC=1 SCAR=6.9
57 0 my $self = shift;
58 0 return { map { $_->name => $_->get_value($self) } $self->get_context_datapoints('column') };
59 }
60  
61  
62 14 1;
63  
64 __END__
« AuditAny/Util/SchemaMaker.pm ↑ Summary AuditAny/DataPoint.pm »