File Coverage

blib/lib/DBIx/Class/AuditAny/Collector/Code.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 20 20 100.0


line stmt bran cond sub pod time code
1             package # Hide from PAUSE
2             DBIx::Class::AuditAny::Collector::Code;
3 2     2   1365 use strict;
  2         3  
  2         139  
4 2     2   8 use warnings;
  2         2  
  2         66  
5              
6             # ABSTRACT: Coderef collector
7              
8 2     2   7 use Moo;
  2         2  
  2         11  
9 2     2   3520 use MooX::Types::MooseLike::Base qw(:all);
  2         3  
  2         812  
10             with 'DBIx::Class::AuditAny::Role::Collector';
11              
12             =head1 NAME
13              
14             DBIx::Class::AuditAny::Collector::Code - Simple CodeRef collector class
15              
16             =head1 DESCRIPTION
17              
18             Using this collector class you can supply a coderef, and it will receive the
19             C<record_changes> data as arguments. This allows you to handle the change data
20             in whatever manner you choose.
21              
22             =head1 ATTRIBUTES
23              
24             =head2 collect_coderef
25              
26             Required. Any valid CodeRef to use to send change data to. Arguments will be
27             supplied in the same form as C<record_changes()>
28              
29             =cut
30              
31             has 'collect_coderef', is => 'ro', isa => CodeRef, required => 1;
32              
33              
34             =head1 METHODS
35              
36             =head2 record_changes
37              
38             =cut
39             sub record_changes {
40 5     5 1 119 my $self = shift;
41 5         32 return $self->collect_coderef->(@_);
42             }
43              
44              
45             1;
46              
47             __END__
48              
49             =head1 SEE ALSO
50              
51             =over
52              
53             =item *
54              
55             L<DBIx::Class::AuditAny>
56              
57             =item *
58              
59             L<DBIx::Class>
60              
61             =back
62              
63             =head1 SUPPORT
64            
65             IRC:
66            
67             Join #rapidapp on irc.perl.org.
68              
69             =head1 AUTHOR
70              
71             Henry Van Styn <vanstyn@cpan.org>
72              
73             =head1 COPYRIGHT AND LICENSE
74              
75             This software is copyright (c) 2012-2015 by IntelliTree Solutions llc.
76              
77             This is free software; you can redistribute it and/or modify it under
78             the same terms as the Perl 5 programming language system itself.
79              
80             =cut