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