App::MojoSlides::Slides - Slide organizer for App::MojoSlides


 my $slides = App::MojoSlides::Slides->new(
   list => ['beginning', 'middle', 'end'],

  -- or --

 my $slides = App::MojoSlides::Slides->new(
   last => 10,


This little class eases some of the organization of slides for App::MojoSlides. You probably don't need to invoke this directly. However, your presentation configuration will contain a slides key, so you might still want to know about it.

Specifically, you will likely need either list or last attributes. If you provide a list, these are the template names which map to slide n+1 when n is the index in the arraref. If you instead provide a last attribute, it will assume your templates are named 1..last.


 App::MojoSlides::Slides->new(2)->last # 2
 App::MojoSlides::Slides->new($arrayref)->list # $arrayref

Since nearly every instance of this class will need either a last or list initialization, the constructor will take a single scalar or arrayrefence as inialization of those attributes respectively.



The ordinal number of the first slide. Defaults to 1, as it should.


The ordinal number of the last slide. Defaults to the number of items in list or else 1.


An arrayref of slide names in order. Optional. If missing your slides should be numbered numerically from first to last.


These methods are used in the MojoSlide system and you probably don't need to use them. Still they exist.


Called with the current slide number and returns the slide number before it, or else first if you are at it.


Called with the current slide number and returns the slide number after it, or else last if you are at it.


Takes an ordinal number (n) and if list is defined, returns the n-1th item, or else it returns the stringified number you passed in.