line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::AttributeHelpers::Collection::Array; |
2
|
5
|
|
|
9
|
|
9952
|
use Mouse; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
42
|
|
3
|
5
|
|
|
5
|
|
6005
|
use MouseX::AttributeHelpers::Collection::List; |
|
5
|
|
|
|
|
271
|
|
|
5
|
|
|
|
|
3516
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'MouseX::AttributeHelpers::Base'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has '+method_constructors' => ( |
8
|
|
|
|
|
|
|
default => sub { |
9
|
|
|
|
|
|
|
my $attr = MouseX::AttributeHelpers::Collection::List->meta->get_attribute('method_constructors'); |
10
|
|
|
|
|
|
|
return +{ |
11
|
|
|
|
|
|
|
%{ $attr->default->() }, # apply MouseX::AttributeHelpers::Collection::List |
12
|
|
|
|
|
|
|
push => sub { |
13
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
14
|
7
|
|
|
7
|
|
14
|
return sub { push @{ shift->$name() } => @_ }; |
|
7
|
|
|
2
|
|
40
|
|
15
|
|
|
|
|
|
|
}, |
16
|
|
|
|
|
|
|
pop => sub { |
17
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
18
|
4
|
|
|
4
|
|
41
|
return sub { pop @{ $_[0]->$name() } }; |
|
4
|
|
|
|
|
48
|
|
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
unshift => sub { |
21
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
22
|
6
|
|
|
8
|
|
11
|
return sub { unshift @{ shift->$name() } => @_ }; |
|
6
|
|
|
|
|
45
|
|
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
shift => sub { |
25
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
26
|
3
|
|
|
7
|
|
7
|
return sub { shift @{ $_[0]->$name() } }; |
|
3
|
|
|
|
|
22
|
|
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
get => sub { |
29
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
30
|
24
|
|
|
26
|
|
141
|
return sub { $_[0]->$name()->[$_[1]] }; |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
set => sub { |
33
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
34
|
3
|
|
|
19
|
|
20
|
return sub { $_[0]->$name()->[$_[1]] = $_[2] }; |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
clear => sub { |
37
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
38
|
3
|
|
|
5
|
|
8
|
return sub { @{ $_[0]->$name() } = () }; |
|
3
|
|
|
|
|
22
|
|
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
delete => sub { |
41
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
42
|
3
|
|
|
5
|
|
6
|
return sub { splice @{ $_[0]->$name() }, $_[1], 1 }; |
|
3
|
|
|
|
|
28
|
|
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
insert => sub { |
45
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
46
|
3
|
|
|
5
|
|
7
|
return sub { splice @{ $_[0]->$name() }, $_[1], 0, $_[2] }; |
|
3
|
|
|
|
|
20
|
|
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
splice => sub { |
49
|
|
|
|
|
|
|
my ($attr, $name) = @_; |
50
|
|
|
|
|
|
|
return sub { |
51
|
3
|
|
|
5
|
|
9
|
my ($self, $offset, $length, @args) = @_; |
52
|
3
|
|
|
|
|
8
|
splice @{ $self->$name() }, $offset, $length, @args; |
|
3
|
|
|
|
|
31
|
|
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
}; |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
0
|
1
|
0
|
sub helper_type { 'ArrayRef' } |
60
|
|
|
|
|
|
|
|
61
|
5
|
|
|
5
|
|
42
|
no Mouse; |
|
5
|
|
|
|
|
102
|
|
|
5
|
|
|
|
|
27
|
|
62
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(inline_constructor => 0); |
63
|
|
|
|
|
|
|
__END__ |