The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rudesind::Captioned - A role for things with captions

SYNOPSIS

  use Class::Roles does => 'Rudesind::Captioned';

  $self->caption

DESCRIPTION

This module provides a role for objects which are captioned, galleries and images. Any class that uses it must provide a _caption_file() method.

It provides the following methods:

  • has_caption

    Returns a boolean indicating whether or not the object has an existing caption.

  • caption

    Returns the object's caption. Returns a false value if no caption exists.

  • save_caption ($caption)

    Given a string, this method saves the caption. If the argument given is undefined or the empty string, it deletes the object's caption file entirely.

  • caption_as_html

    Calls Rudesind::UI::text_to_html() to turn the object's caption into HTML.