| 1 | package Net::Gnip::FilterStream; | ||
| 2 | |||
| 3 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use base qw(Net::Gnip::BaseStream); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 6 | ▶ | use Net::Gnip::Filter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | 6 | ▶ | sub filters { |
|
Subroutine
filters: called CC=1 SCAR=0.0
Pod
documented
| |||
| 56 | 6 | my $self = shift; | |
| 57 | 6 | return $self->children(@_); | |
| 58 | } | ||
| 59 | |||
| 60 | 2 | ▶ | sub _child_name { 'filter' } |
|
Subroutine
_child_name: called CC=1 SCAR=0.0
| |||
| 61 | |||
| 62 | 1 | ▶ | sub _elem_name { 'filters' } |
|
Subroutine
_elem_name: called CC=1 SCAR=0.0
| |||
| 63 | 6 | 1; | |