NAME

Wizard::State - A class for storing the Wizard state.

SYNOPSIS

# Create a new state
my $state = Wizard::State->new();

DESCRIPTION

A Wizard can be interpreted as a very simple finite state machine. The state is stored in ab object of class Wizard::State.

A wizard state is typically a collection of Wizard::SaveAble objects. For example, while configuring an Apache webserver, the state might have attributes prefs (global preferences), host (the machine where the webserver is running on) and server (the web server), each of them being a SaveAble object. If the state's Store method is called, then the Store method is called for any of these objects, as if they were a single object.

CLASS INTERFACE

Constructor

my $state = Wizard::State->new(\%attr)

(Class Method) A new object is generated by calling its new method. The object attributes are passed as a hash ref.

Terminating the application

# Stopping the application
$state->Running(0);

# Querying whether the application is running
$is_running = $state->Running();

(Instance method) The state's Running method can be used to set or get its running attribute. This attribute will be set to 0 for stopping the application.

Storing a state

# Storing a state temporarily; real SaveAble objects won't be
# changed
$state->Store($wiz);

# Storing a state, including the SaveAble objects.
$state->Store($wiz, 1);

AUTHORS AND COPYRIGHT

This module is

Copyright (C) 1999     Jochen Wiedmann
                       Am Eisteich 9
                       72555 Metzingen
                       Germany

                       Email: joe@ispsoft.de
                       Phone: +49 7123 14887

               and     Amarendran R. Subramanian
                       Grundstr. 32
                       72810 Gomaringen
                       Germany

                       Email: amar@ispsoft.de
                       Phone: +49 7072 920696

All Rights Reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.