line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Clone::Meta::Attribute::Trait::Clone::Std; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
1570
|
use Moose::Role; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
6
|
2
|
|
|
2
|
|
9436
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with qw(MooseX::Clone::Meta::Attribute::Trait::Clone::Base); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires qw(clone_value_data); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub clone_value { |
13
|
5
|
|
|
5
|
0
|
14
|
my ( $self, $target, $proto, %args ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
5
|
50
|
|
|
|
17
|
if ( exists $args{init_arg} ) { |
16
|
0
|
|
|
|
|
0
|
$self->set_value( $target, $args{init_arg} ); |
17
|
|
|
|
|
|
|
} else { |
18
|
5
|
100
|
|
|
|
18
|
return unless $self->has_value($proto); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
28
|
my $clone = $self->clone_value_data( scalar($self->get_value($proto)), %args ); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
18
|
$self->set_value( $target, $clone ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__PACKAGE__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |