line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnip::PublisherStream; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
6772
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
96
|
|
4
|
2
|
|
|
2
|
|
12
|
use base qw(Net::Gnip::BaseStream); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
236
|
|
5
|
|
|
|
|
|
|
use Net::Gnip::Publisher; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Net::Gnip::PublisherStream - represent a list of Gnip Publisher |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Create a new stream |
15
|
|
|
|
|
|
|
my $stream = Net::Gnip::PublisherStream->new(); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# ... or parse from XML |
18
|
|
|
|
|
|
|
my $stream = Net::Gnip::FilterStream->parse($xml); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# set the publishers |
21
|
|
|
|
|
|
|
$stream->publishers(@publisher); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# get the publishers |
24
|
|
|
|
|
|
|
my @publishers = $stream->publishers; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# or use an iterator |
27
|
|
|
|
|
|
|
while (my $publisher = $stream->next) { |
28
|
|
|
|
|
|
|
print $publisher->name; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$stream->reset; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# ... now you can use it again |
34
|
|
|
|
|
|
|
while (my $publisher = $stream->next) { |
35
|
|
|
|
|
|
|
print $publisher->name; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Create a new, empty stream |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 publishers [publisher[s]] |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Get or set the publishers |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub publishers { |
55
|
|
|
|
|
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
return $self->children(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub _child_name { 'publisher' } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _elem_name { 'publishers' } |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |