WebService::OpenSky::Utils::Iterator - Internal iterator class for WebService::OpenSky
version 0.4
use WebService::OpenSky::Utils::Iterator; my $results = WebService::OpenSky::Utils::Iterator->new( rows => [ 1, 2, 3 ] ); while ( my $result = $results->next ) { ... }
A simple iterator class. To keep it dead simple, it only allows defined values to be passed in.
next
while ( my $result = $results->next ) { ... }
Returns the next member in the iterator. Returns undef if the iterator is exhausted.
undef
count
if ( $results->count ) { ... }
Returns the number of members in the iterator.
first
my $object = $results->first;
Returns the first object in the results.
reset
$results->reset;
Resets the iterator to point to the first member.
all
my @objects = $results->all;
Returns a list of all members in the iterator.
Curtis "Ovid" Poe <curtis.poe@gmail.com>
This software is Copyright (c) 2023 by Curtis "Ovid" Poe.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install WebService::OpenSky, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::OpenSky
CPAN shell
perl -MCPAN -e shell install WebService::OpenSky
For more information on module installation, please visit the detailed CPAN module installation guide.