App-MojoSlides
view release on metacpan or search on metacpan
lib/App/MojoSlides/Slides.pm view on Meta::CPAN
has 'list';
sub new {
my $class = shift;
my $args;
if (@_==1) {
$args = { last => $_[0] } unless ref $_[0];
$args = { list => $_[0] } if ref $_[0] eq 'ARRAY';
}
return $class->SUPER::new($args ? $args : @_);
}
sub prev {
my ($self, $current) = @_;
return $current == $self->first ? $current : $current - 1;
}
sub next {
my ($self, $current) = @_;
return $current == $self->last ? $current : $current + 1;
( run in 0.414 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )