NAME

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

SYNOPSIS

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

  -- or --

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

DESCRIPTION

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.

CONSTRUCTOR

 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.

ATTRIBUTES

first

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

last

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

last

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

METHODS

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

prev

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

next

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

template_for

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.