line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::AttributeHelpers::String; |
2
|
7
|
|
|
13
|
|
11317
|
use Mouse; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
49
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
extends 'MouseX::AttributeHelpers::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has '+method_constructors' => ( |
7
|
|
|
|
|
|
|
default => sub { |
8
|
|
|
|
|
|
|
return +{ |
9
|
|
|
|
|
|
|
append => sub { |
10
|
|
|
|
|
|
|
my (undef, $name) = @_; |
11
|
14
|
|
|
14
|
|
5604
|
return sub { $_[0]->{$name} .= $_[1] }; |
|
|
|
|
2
|
|
|
|
12
|
|
|
|
|
|
|
}, |
13
|
|
|
|
|
|
|
prepend => sub { |
14
|
|
|
|
|
|
|
my (undef, $name) = @_; |
15
|
4
|
|
|
4
|
|
2251
|
return sub { $_[0]->{$name} = $_[1] . $_[0]->{$name} }; |
16
|
|
|
|
|
|
|
}, |
17
|
|
|
|
|
|
|
replace => sub { |
18
|
|
|
|
|
|
|
my (undef, $name) = @_; |
19
|
|
|
|
|
|
|
return sub { |
20
|
8
|
50
|
50
|
10
|
|
121
|
(ref $_[2] || '') eq 'CODE' |
21
|
8
|
|
|
|
|
32
|
? $_[0]->{$name} =~ s/$_[1]/$_[2]->()/e |
22
|
|
|
|
|
|
|
: $_[0]->{$name} =~ s/$_[1]/$_[2]/; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
match => sub { |
26
|
|
|
|
|
|
|
my (undef, $name) = @_; |
27
|
12
|
|
|
16
|
|
2246
|
return sub { $_[0]->{$name} =~ $_[1] }; |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
chop => sub { |
30
|
|
|
|
|
|
|
my (undef, $name) = @_; |
31
|
4
|
|
|
10
|
|
2194
|
return sub { chop $_[0]->{$name} }; |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
chomp => sub { |
34
|
|
|
|
|
|
|
my (undef, $name) = @_; |
35
|
8
|
|
|
10
|
|
5018
|
return sub { chomp $_[0]->{$name} }; |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
inc => sub { |
38
|
|
|
|
|
|
|
my (undef, $name) = @_; |
39
|
8
|
|
|
12
|
|
35065
|
return sub { $_[0]->{$name}++ }; |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
clear => sub { |
42
|
|
|
|
|
|
|
my (undef, $name) = @_; |
43
|
4
|
|
|
8
|
|
20
|
return sub { $_[0]->{$name} = '' }; |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
1
|
1
|
4
|
sub helper_type { 'Str' } |
50
|
2
|
|
|
2
|
1
|
74
|
sub helper_default { '' } |
51
|
|
|
|
|
|
|
|
52
|
7
|
|
|
7
|
|
5691
|
no Mouse; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
37
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(inline_constructor => 0); |
54
|
|
|
|
|
|
|
__END__ |