line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Google::Chart::Type::QRcode; |
4
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
17322
|
use Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
6
|
1
|
|
|
1
|
|
6757
|
use Encode (); |
|
1
|
|
|
|
|
34200
|
|
|
1
|
|
|
|
|
233
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
enum 'Google::Chart::Type::QRcode::Encoding' => qw(shift_jis utf-8 iso-8859-1); |
9
|
|
|
|
|
|
|
enum 'Google::Chart::Type::QRcode::ECLevel' => qw(L M Q H); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
coerce 'Google::Chart::Type::QRcode::Encoding' |
12
|
|
|
|
|
|
|
=> from 'Str' |
13
|
|
|
|
|
|
|
=> via { |
14
|
|
|
|
|
|
|
s/^Shift[-_]JIS$/shift_jis/ || |
15
|
|
|
|
|
|
|
s/^UTF-?8$/utf-8/ || |
16
|
|
|
|
|
|
|
return lc $_; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
with 'Google::Chart::Type'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has 'text' => ( |
23
|
|
|
|
|
|
|
is => 'rw', |
24
|
|
|
|
|
|
|
isa => 'Str', |
25
|
|
|
|
|
|
|
required => 1 |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has 'encoding' => ( |
29
|
|
|
|
|
|
|
is => 'rw', |
30
|
|
|
|
|
|
|
isa => 'Google::Chart::Type::QRcode::Encoding', |
31
|
|
|
|
|
|
|
required => 1, |
32
|
|
|
|
|
|
|
default => 'utf-8', |
33
|
|
|
|
|
|
|
coerce => 1 |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
has 'eclevel' => ( |
37
|
|
|
|
|
|
|
is => 'rw', |
38
|
|
|
|
|
|
|
isa => 'Google::Chart::Type::QRcode::ECLevel', |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has 'margin' => ( |
42
|
|
|
|
|
|
|
is => 'rw', |
43
|
|
|
|
|
|
|
isa => 'Num' |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
1
|
|
14
|
no Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
21
|
|
49
|
1
|
|
|
1
|
|
419
|
no Moose::Util::TypeConstraints; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub as_query { |
52
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
53
|
0
|
0
|
0
|
|
|
|
my %data = ( |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
54
|
|
|
|
|
|
|
cht => 'qr', |
55
|
|
|
|
|
|
|
chl => Encode::is_utf8($self->text) ? |
56
|
|
|
|
|
|
|
Encode::decode_utf8($self->text) : $self->text, |
57
|
|
|
|
|
|
|
choe => $self->encoding, |
58
|
|
|
|
|
|
|
chld => $self->eclevel || $self->margin ? |
59
|
|
|
|
|
|
|
join( '|', $self->eclevel || '', $self->margin || '') : '' |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return %data; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 NAME |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Google::Chart::Type::QRcode - Google::Chart QRcode Type |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 METHODS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 as_query |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |