| 1 | package Test::DBChanges::Role::Base; | ||
| 2 | 2 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use 5.024; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use Types::Standard qw(ArrayRef Str); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use Test::DBChanges::ChangeSet; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | our $VERSION = '1.0.2'; # VERSION | |
| 9 | # ABSTRACT: base role for all DBChanges classes | ||
| 10 | |||
| 11 | |||
| 12 | 2 | has source_names => ( is => 'ro', required => 1, isa => ArrayRef[Str] ); | |
| 13 | |||
| 14 | has _table_source_map => ( | ||
| 15 | is => 'lazy', | ||
| 16 | 0 | ▶ | builder => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Subroutine
_build__table_source_map: not called CC=1 SCAR=6.9
| |||
| 17 | 0 | my ($self) = @_; | |
| 18 | |||
| 19 | my %table_source_map = map { | ||
| 20 | 0 | my $source_name = $_; | |
| 21 | 0 | my ($table_name, $factory) = $self->_table_and_factory_for_source($source_name); | |
| 22 | 0 | ( $table_name => { name => $source_name, factory => $factory } ); | |
| 23 | } $self->source_names->@*; | ||
| 24 | |||
| 25 | 0 | return \%table_source_map; | |
| 26 | }, | ||
| 27 | 2 | ); | |
| 28 | |||
| 29 | 2 | requires qw(_table_and_factory_for_source changeset_for_code); | |
| 30 | |||
| 31 | 0 | ▶ | sub _make_changeset { |
|
Subroutine
_make_changeset: not called CC=1 SCAR=6.9
| |||
| 32 | 0 | my ($self,$raw_changes) = @_; | |
| 33 | |||
| 34 | 0 | return Test::DBChanges::ChangeSet->new({ | |
| 35 | table_source_map => $self->_table_source_map, | ||
| 36 | raw_changes => $raw_changes, | ||
| 37 | }); | ||
| 38 | } | ||
| 39 | |||
| 40 | 2 | 1; | |
| 41 | |||
| 42 | __END__ | ||