line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Facebook::InstantArticle::List; |
2
|
2
|
|
|
2
|
|
13
|
use Moose; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
3
|
2
|
|
|
2
|
|
11588
|
use namespace::autoclean; |
|
2
|
|
|
|
|
30
|
|
|
2
|
|
|
|
|
19
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Facebook::InstantArticle::BaseElement'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'elements' => ( |
8
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
9
|
|
|
|
|
|
|
is => 'rw', |
10
|
|
|
|
|
|
|
required => 0, |
11
|
|
|
|
|
|
|
default => sub { [] }, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'ordered' => ( |
15
|
|
|
|
|
|
|
isa => 'Bool', |
16
|
|
|
|
|
|
|
is => 'rw', |
17
|
|
|
|
|
|
|
required => 0, |
18
|
|
|
|
|
|
|
default => 0, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has 'is_valid' => ( |
22
|
|
|
|
|
|
|
isa => 'Bool', |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
lazy => 1, |
25
|
|
|
|
|
|
|
default => sub { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return scalar @{ $self->elements } ? 1 : 0; |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
has 'as_xml_gen' => ( |
33
|
|
|
|
|
|
|
isa => 'Object', |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
lazy => 1, |
36
|
|
|
|
|
|
|
builder => '_build_as_xml_gen', |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _build_as_xml_gen { |
40
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
5
|
my $gen = XML::Generator->new( ':pretty' ); |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
108
|
my $tag = ( $self->ordered ) ? 'ol' : 'ul'; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
return $gen->$tag( |
47
|
1
|
|
|
|
|
3
|
map { $gen->li(\$_) } @{ $self->elements }, |
|
3
|
|
|
|
|
153
|
|
|
1
|
|
|
|
|
25
|
|
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |