line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PagSeguro::API::Util; |
2
|
4
|
|
|
4
|
|
14610
|
use Exporter 'import'; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
900
|
|
3
|
|
|
|
|
|
|
our @EXPORT = qw(camelize decamelize); |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# camelize |
6
|
|
|
|
|
|
|
sub camelize { |
7
|
1
|
|
|
1
|
1
|
865
|
my $str = shift; |
8
|
2
|
|
|
|
|
12
|
return join '', map { |
9
|
1
|
|
|
|
|
5
|
ucfirst lc |
10
|
|
|
|
|
|
|
} split '_', $str; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# decamelize |
14
|
|
|
|
|
|
|
sub decamelize { |
15
|
1
|
|
|
1
|
1
|
1908
|
my $str = shift; |
16
|
1
|
|
|
|
|
8
|
$str =~ s/^([A-Z])(.*)$/lc($1).$2/e; |
|
1
|
|
|
|
|
5
|
|
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
8
|
return join '', map { |
19
|
1
|
|
|
|
|
5
|
s/([A-Z])/_$1/; lc; |
|
6
|
|
|
|
|
12
|
|
20
|
|
|
|
|
|
|
} split '', $str; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
__END__ |