Solstice::HelpService - A service for building a queue of text strings


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::HelpService - A service for building a queue of text strings

SYNOPSIS

Top

  use Solstice::HelpService;
  my $help_service = new Solstice::HelpService;

  my $str = 'Blah blah';

  $help_service->addHelp($str);
  $help_service->clearPageHelp();

  # Returns an array ref
  my $help_list = $help_service->getPageHelp();

DESCRIPTION

Top

Superclass

Solstice::Service

Export

No symbols exported.

Methods

new()

Creates a new HelpSystem object.

addHelp($string)
getPageHelp()

Returns an array ref of all help objects added to the page.

clearPageHelp()

Removes all help objects added to the page.

Private Methods

_getClassName()

Return the class name. Overridden to avoid a ref() in the superclass.

Modules Used

Solstice::Service.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::HelpService;

# $Id: HelpService.pm 3364 2006-05-05 07:18:21Z mcrawfor $

use 5.006_000;
use strict;
use warnings;

use base qw(Solstice::Service);

our ($VERSION) = ('$Revision: 3364 $' =~ /^\$Revision:\s*([\d.]*)/);

sub new {
    my $class = shift;
    return $class->SUPER::new(@_);
}

sub addHelp {
    my $self = shift;
    my $help = shift;

    return 0 unless defined $help;
    
    my $help_queue = $self->get('help_queue') || [];
    
    push @$help_queue, $help;

    $self->set('help_queue', $help_queue);

    return 1;
}

sub getPageHelp {
    my $self = shift;
    return $self->get('help_queue') || [];
}

sub clearPageHelp {
    my $self = shift;
    $self->set('help_queue', undef);
    return 1;
}


sub _getClassName {
    return 'Solstice::HelpService';
}


1;
__END__