line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::GData::Node::Atom::AtomEntity; |
2
|
14
|
|
|
14
|
|
93
|
use base 'WebService::GData::Node::AbstractEntity'; |
|
14
|
|
|
|
|
28
|
|
|
14
|
|
|
|
|
10523
|
|
3
|
|
|
|
|
|
|
|
4
|
14
|
|
|
14
|
|
23119
|
use WebService::GData::Node::Atom::AuthorEntity(); |
|
14
|
|
|
|
|
43
|
|
|
14
|
|
|
|
|
284
|
|
5
|
14
|
|
|
14
|
|
7902
|
use WebService::GData::Node::Atom::Category(); |
|
14
|
|
|
|
|
40
|
|
|
14
|
|
|
|
|
256
|
|
6
|
14
|
|
|
14
|
|
8269
|
use WebService::GData::Node::Atom::Id(); |
|
14
|
|
|
|
|
34
|
|
|
14
|
|
|
|
|
268
|
|
7
|
14
|
|
|
14
|
|
8181
|
use WebService::GData::Node::Atom::Link(); |
|
14
|
|
|
|
|
41
|
|
|
14
|
|
|
|
|
271
|
|
8
|
14
|
|
|
14
|
|
8452
|
use WebService::GData::Node::Atom::Title(); |
|
14
|
|
|
|
|
41
|
|
|
14
|
|
|
|
|
273
|
|
9
|
14
|
|
|
14
|
|
10506
|
use WebService::GData::Node::Atom::Updated(); |
|
14
|
|
|
|
|
37
|
|
|
14
|
|
|
|
|
311
|
|
10
|
14
|
|
|
14
|
|
7341
|
use WebService::GData::Collection; |
|
14
|
|
|
|
|
37
|
|
|
14
|
|
|
|
|
137
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.01_02; |
13
|
|
|
|
|
|
|
my $BASE = 'WebService::GData::Node::Atom::'; |
14
|
|
|
|
|
|
|
sub __init { |
15
|
10
|
|
|
10
|
|
25
|
my ( $this, $params ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
10
|
|
|
|
|
3118
|
$this->{_feed} = {}; |
18
|
|
|
|
|
|
|
|
19
|
10
|
100
|
|
|
|
60
|
if ( ref($params) eq 'HASH' ) { |
20
|
9
|
|
66
|
|
|
86
|
$this->{_feed} = $params->{feed} || $params; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
10
|
|
|
|
|
128
|
$this->_set_tag ( $BASE, 'AuthorEntity' , 'author',1 ); |
24
|
10
|
|
|
|
|
130
|
$this->_init_tags( $BASE, undef , (qw(id title updated)) ); |
25
|
|
|
|
|
|
|
|
26
|
10
|
|
|
|
|
50
|
$this->_init_tags( $BASE, 'force_collection' , (qw(category link)) ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub set_children { |
30
|
10
|
|
|
10
|
0
|
22
|
my $this = shift; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$this->_entity->child( $this->{ '_' . $_ } ) |
33
|
10
|
|
|
|
|
63
|
foreach ( (qw(author category id link title updated)) ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
private _set_tag => sub { |
37
|
|
|
|
|
|
|
my ( $this, $package, $class, $node, $collection ) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$class = $package . "\u$class"; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
if ( ref( $this->{_feed}->{$node} ) eq 'ARRAY' ) { |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$this->{ '_' . $node } = |
44
|
|
|
|
|
|
|
_create_collection( $this->{_feed}->{$node}, $class ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else { |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
if ($collection) { |
49
|
|
|
|
|
|
|
my $data; |
50
|
|
|
|
|
|
|
$data = $class->new( $this->{_feed}->{$node} ) |
51
|
|
|
|
|
|
|
if $this->{_feed}->{$node}; |
52
|
|
|
|
|
|
|
$this->{ '_' . $node } = |
53
|
|
|
|
|
|
|
_create_collection( $data ? [$data] : [], $class ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
else { |
56
|
|
|
|
|
|
|
$this->{ '_' . $node } = $class->new( $this->{_feed}->{$node} ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
private _init_tags => sub { |
63
|
|
|
|
|
|
|
my ( $this, $package, $collection, @nodes ) = @_; |
64
|
|
|
|
|
|
|
foreach my $node (@nodes) { |
65
|
|
|
|
|
|
|
$this->_set_tag( $package, "\u$node", $node, $collection ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
}; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
private _create_collection => sub { |
70
|
|
|
|
|
|
|
my ( $data, $class ) = @_; |
71
|
|
|
|
|
|
|
return new WebService::GData::Collection( |
72
|
|
|
|
|
|
|
$data, |
73
|
|
|
|
|
|
|
undef, |
74
|
|
|
|
|
|
|
sub { |
75
|
|
|
|
|
|
|
my $val = shift; |
76
|
|
|
|
|
|
|
return $class->new($val) if ref $val ne $class; |
77
|
|
|
|
|
|
|
$val; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub links { |
84
|
19
|
|
|
19
|
0
|
360
|
my $this = shift; |
85
|
19
|
|
|
|
|
154
|
$this->link; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub get_link { |
89
|
4
|
|
|
4
|
0
|
11
|
my ( $this, $search ) = @_; |
90
|
4
|
|
|
|
|
21
|
my $link = $this->link->rel($search)->[0]; |
91
|
4
|
100
|
|
|
|
19
|
return $link->href if ($link); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
"The earth is blue like an orange."; |