line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SQL::Translator::Role::BuildArgs; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
SQL::Translator::Role::BuildArgs - Remove undefined constructor arguments |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Foo; |
10
|
|
|
|
|
|
|
use Moo; |
11
|
|
|
|
|
|
|
with qw(SQL::Translator::Role::BuildArgs); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
This L wraps BUILDARGS to remove C constructor |
16
|
|
|
|
|
|
|
arguments for backwards compatibility with the old L-based |
17
|
|
|
|
|
|
|
L. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
72
|
|
|
72
|
|
40895
|
use Moo::Role; |
|
72
|
|
|
|
|
208
|
|
|
72
|
|
|
|
|
463
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
around BUILDARGS => sub { |
24
|
|
|
|
|
|
|
my $orig = shift; |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
my $args = $self->$orig(@_); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
foreach my $arg (keys %{$args}) { |
29
|
|
|
|
|
|
|
delete $args->{$arg} unless defined($args->{$arg}); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
return $args; |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |