Rudesind::Gallery - A gallery which may contain both images and other galleries
use Rudesind::Gallery; my $gallery = Rudesind::Gallery->new( path => '/', config => $config ); foreach my $img ( $gallery->images ) { ... }
This class represents a gallery. A gallery can contain both images as well as other galleries.
The new() method requires two parameters:
new()
path
The URI path for the gallery. The top-level gallery will always have be /.
config
A Rudesind::Config object.
Rudesind::Config
If no filesystem directory matches the given path, then the constructor returns false.
This class provides the following methods:
path()
The URI path for this gallery.
URI
uri()
The same value as path(). Provided for the use of the Mason UI. Use path() instead.
title()
A title for the gallery. Currently, this is just the last portion of the path, or "top" if the path is /.
config()
The Rudesind::Config object given to the constructor.
subgalleries()
Returns a list of Rudesind::Gallery objects, each of which is a gallery contained by the object this method is called on.
Rudesind::Gallery
The list is sorted by title (the last portion of the gallery's path).
images()
Returns a list of Rudesind::Image objects, each of which is an image contained by the object this method is called on.
Rudesind::Image
The list is sorted by title (the image file's name).
image($filename)
Given a filename (without a path), this method returns a new Rudesind::Image object for that image. Tihs is the constructor for image objects.
If no such file exists in the gallery, then this method returns a false value.
previous_image($image)
next_image($image)
Given an image object, these methods return the previous or next image object in the gallery, if one exists.
This class uses the Rudesind::Captioned role.
Rudesind::Captioned
To install Rudesind, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rudesind
CPAN shell
perl -MCPAN -e shell install Rudesind
For more information on module installation, please visit the detailed CPAN module installation guide.