| 1 | package # Hide from PAUSE | ||
| 2 | DBIx::Class::AuditAny::Collector::Code; | ||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | # ABSTRACT: Coderef collector | ||
| 7 | |||
| 8 | 2 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use MooX::Types::MooseLike::Base qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | 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 | 2 | has 'collect_coderef', is => 'ro', isa => CodeRef, required => 1; | |
| 32 | |||
| 33 | |||
| 34 | =head1 METHODS | ||
| 35 | |||
| 36 | =head2 record_changes | ||
| 37 | |||
| 38 | =cut | ||
| 39 | 0 | ▶ | sub record_changes { |
|
Subroutine
record_changes: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 40 | 0 | my $self = shift; | |
| 41 | 0 | return $self->collect_coderef->(@_); | |
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | 2 | 1; | |
| 46 | |||
| 47 | __END__ | ||