AuditAny/AuditContext.pm

filter: Statementstmt 47.2% 17 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod 100% 8 / 8 totaltotal 48.3% 30 / 62 CC 4 SCAR 13.7
CC
4
Cov
42%
get_datapoint_value
12.0
get_datapoints_data
6.0
_build_tiedContexts
2.0
CRAP 3.9
« AuditAny/AuditContext/Source.pm ↑ Summary AuditAny/Collector/AutoDBIC.pm »
1 package # Hide from PAUSE
2 DBIx::Class::AuditAny::AuditContext;
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Base class for context objects in DBIx::Class::AuditAny
7  
8 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 12 ▶use MooX::Types::MooseLike::Base qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 DBIx::Class::AuditAny::AuditContext - Base class for context objects in DBIx::Class::AuditAny
14  
15 =head1 DESCRIPTION
16  
17 This class is used internally and typically does not need to be called directly
18  
19 =head1 ATTRIBUTES
20  
21 =head2 AuditObj
22  
23 Required. Reference to the Auditor object (L<DBIx::Class::AuditAny>).
24  
25 =cut
26 12 has 'AuditObj', is => 'ro', isa => InstanceOf['DBIx::Class::AuditAny'], required => 1;
27  
28 =head2 tiedContexts
29  
30 Used internally
31  
32 =cut
33 12 has 'tiedContexts', is => 'lazy', isa => ArrayRef[Object];#, lazy_build => 1;
34  
35 =head2 local_datapoint_data
36  
37 Used internally
38  
39 =cut
40 12 has 'local_datapoint_data', is => 'lazy', isa => HashRef;#, lazy_build => 1;
41  
42 0 ▶sub _build_tiedContexts { die "Virtual method" }
Subroutine _build_tiedContexts: not called CC=1 SCAR=6.9
43 0 ▶sub _build_local_datapoint_data { die "Virtual method" }
Subroutine _build_local_datapoint_data: not called CC=1 SCAR=6.9
44  
45  
46 =head1 METHODS
47  
48 =head2 get_datapoint_value
49  
50 =cut
51 sub get_datapoint_value {
52 0 ▶ my $self = shift;
Subroutine get_datapoint_value: not called CC=3 SCAR=24.8
Pod documented
53 0 my $name = shift;
54 0 my @Contexts = ($self,@{$self->tiedContexts},$self->AuditObj);
55 0 foreach my $Context (@Contexts) {
56 return $Context->local_datapoint_data->{$name}
57 0 ▶ if (exists $Context->local_datapoint_data->{$name});
Branch: 1 branch
BranchTrueFalseTotal
if exists $Context->local_datapoint_data->{$name} 0 0 0
58 }
59 0 die "Unknown datapoint '$name'";
60 }
61  
62 =head2 get_datapoints_data
63  
64 =cut
65 sub get_datapoints_data {
66 0 ▶ my $self = shift;
Subroutine get_datapoints_data: not called CC=2 SCAR=17.9
Pod documented
67 0 ▶ my @names = (ref($_[0]) eq 'ARRAY') ? @{ $_[0] } : @_; # <-- arg as array or arrayref
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'ARRAY' ? : 0 0 0
68 0 return { map { $_ => $self->get_datapoint_value($_) } @names };
69 }
70  
71  
72 =head2 SchemaObj
73  
74 =cut
75 0 ▶sub SchemaObj { (shift)->AuditObj->schema };
Subroutine SchemaObj: not called CC=1 SCAR=6.9
Pod documented
76  
77  
78 =head2 schema
79  
80 =cut
81 0 ▶sub schema { ref (shift)->AuditObj->schema };
Subroutine schema: not called CC=1 SCAR=6.9
Pod documented
82  
83  
84 =head2 primary_key_separator
85  
86 =cut
87 0 ▶sub primary_key_separator { (shift)->AuditObj->primary_key_separator };
Subroutine primary_key_separator: not called CC=1 SCAR=6.9
Pod documented
88  
89  
90 =head2 get_context_datapoints
91  
92 =cut
93 0 ▶sub get_context_datapoints { (shift)->AuditObj->get_context_datapoints(@_) };
Subroutine get_context_datapoints: not called CC=1 SCAR=6.9
Pod documented
94  
95  
96 =head2 get_context_datapoint_names
97  
98 =cut
99 0 ▶sub get_context_datapoint_names { (shift)->AuditObj->get_context_datapoint_names(@_) };
Subroutine get_context_datapoint_names: not called CC=1 SCAR=6.9
Pod documented
100  
101  
102 =head2 get_dt
103  
104 =cut
105 4 ▶sub get_dt { (shift)->AuditObj->get_dt(@_) };
Subroutine get_dt: called CC=1 SCAR=0.0
Pod documented
106  
107 12 1;
108  
109 __END__
110  
111 =head1 SEE ALSO
112  
113 =over
114  
115 =item *
116  
117 L<DBIx::Class::AuditAny>
118  
119 =item *
120  
121 L<DBIx::Class>
122  
123 =back
124  
125 =head1 SUPPORT
126
127 IRC:
128
129 Join #rapidapp on irc.perl.org.
130  
131 =head1 AUTHOR
132  
133 Henry Van Styn <vanstyn@cpan.org>
134  
135 =head1 COPYRIGHT AND LICENSE
136  
137 This software is copyright (c) 2012-2015 by IntelliTree Solutions llc.
138  
139 This is free software; you can redistribute it and/or modify it under
140 the same terms as the Perl 5 programming language system itself.
141  
142 =cut
« AuditAny/AuditContext/Source.pm ↑ Summary AuditAny/Collector/AutoDBIC.pm »