Basset::Machine::State - used to create machine states.


Basset documentation  | view source Contained in the Basset distribution.

Index


NAME

Top

Basset::Machine::State - used to create machine states.

AUTHOR

Top

Jim Thomason, jim@jimandkoka.com

DESCRIPTION

Top

Read the pod on Basset::Machine for more information on machines. Basset::Machine::State is a mostly abstract superclass for states defined to work with machines.

 package Some::Machine::Foozle;
 use base 'Basset::Machine::State';

 sub main {
 	my $self = shift;
 	my $machine = $self->machine;

 	#do interesting things.

 	return $machine->transition('beezle');
 }

states live under their machine ('My::Machine' requires 'My::Machine::State1', 'My::Machine::State2', etc.) and are entered via the method ->main, which the machine calls when the state is entered.

ATTRIBUTES

Top

machine

The machine associated with this state.

METHODS

Top

main

abstract super method. You will need to override this with the code for your state. This implementation only aborts the machine.


Basset documentation  | view source Contained in the Basset distribution.