-
-
07 Nov 2014 04:13:33 UTC
- Distribution: Games-Dukedom
- Module version: v0.1.2
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers
- Kwalitee
Bus factor: 1- 17.09% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (24.88KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Jim Bacon
- Dependencies
- Moo
- MooX::ClassAttribute
- MooX::StrictConstructor
- MooX::Struct
- Throwable
- Try::Tiny
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Games::Dukedom::Signal = provide "interrupts" to drive the state-machine
SYNOPSIS
use Games::Dukedom; my $game = Games::Dukedom->new(); $game->throw( 'This is a simple message' ); $game->throw( msg => 'This is also a simple message', ) $game->throw( msg => 'Do you want to be King? ', action => 'get_yn', ) $game->throw( msg => 'Are you sure [Y/n]? ', action => 'get_yn', default => 'Y' )
DESCRIPTION
This module is used to signal the application code that a display or input action is needed. This is accomplished by means of the Throwable role.
ATTRIBUTES
All attributes have read-only accessors.
msg
Holds a message to be presented to the user by the caller, if present.
action
Tells the caller what action should be taken before re-entering the main state-machine loop, if present. Currently takes one of the following values:
undef
-
Indicates that no action is needed other than displaying any message that is present.
get_yn
-
Indicates that the caller should supply a "y" or "n" response in
$game->input
. get_value
-
Indicates that the caller should supply a numeric response in
$game->input
.
default
Provides a default response, if present, that may be used if desired to satisfy the requested action.
METHODS
as_string
This method will provide a string representing the error, containing the error's message.
SEE ALSO
AUTHOR
Jim Bacon, <jim@nortx.com>
COPYRIGHT AND LICENSE
Copyright (C) 2014 by Jim Bacon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install Games::Dukedom, copy and paste the appropriate command in to your terminal.
cpanm Games::Dukedom
perl -MCPAN -e shell install Games::Dukedom
For more information on module installation, please visit the detailed CPAN module installation guide.