| Net-Gnip documentation | Contained in the Net-Gnip distribution. |
Net::Gnip::FilterStream - represent a list of Gnip Filters
# Create a new stream
my $stream = Net::Gnip::FilterStream->new();
# ... or parse from XML
my $stream = Net::Gnip::FilterStream->parse($xml);
# set the filters
$stream->filters(@filters);
# get the filters
my @filters = $stream->filters;
# or use an iterator
while (my $filter = $stream->next) {
print $filter->name;
}
$stream->reset;
# ... now you can use it again
while (my $filter = $stream->next) {
print $filter->name;
}
Create a new, empty stream
Get or set the filters
| Net-Gnip documentation | Contained in the Net-Gnip distribution. |
package Net::Gnip::FilterStream; use strict; use base qw(Net::Gnip::BaseStream); use Net::Gnip::Filter;
sub filters { my $self = shift; return $self->children(@_); } sub _child_name { 'filter' } sub _elem_name { 'filters' } 1;