NAME
Meta::Types::Bool - an object oriented boolean type.
COPYRIGHT
Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.
LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
DETAILS
MANIFEST: Bool.pm
PROJECT: meta
VERSION: 0.00
SYNOPSIS
package foo;
use Meta::Types::Bool qw();
my($object)=Meta::Types::Bool->new();
my($result)=$object->method();
DESCRIPTION
This class provides you with a boolean object which can accept many forms of input and output itself in many forms. The idea is for this class to hold only the boolean value in a pure form (either 0 or 1) and be able to do boolean arithmetic on that value while the input (at construction or at arithmetic time) and the output could have many forms like y/n, 0/1, yes/no, true/false, t/f etc... The versions currently supported are :
FUNCTIONS
new($)
new_value($$)
set_value($$)
get_value($)
new_version($$$)
set_version($$$)
get_version($$)
not($)
TEST($)
FUNCTION DOCUMENTATION
- new($)
-
This is a constructor for the Meta::Types::Bool object. By default the value of it is 1 (true).
- new_value($$)
-
This is a value constructor for the Meta::Types::Bool object. If the value you passed evaluates to true then the type will have a 1 (true) value.
- set_value($$)
-
Give this method a value and it will set the internal value of the boolean according to whether your value evaluates to true.
- get_value($)
-
This method retrieves the current value of the boolean.
- new_version($$$)
-
Pass a value and a version to this constructor and it will give you an object with the internal value stored accordingly.
- set_version($$$)
-
Pass a version and value to this method and it will set the internal boolean value accordingly.
- get_version($$)
-
Pass a version to this method and you will get the boolean value converted to this version.
- not($)
-
This method will perform a boolean NOT operation on the value stored.
- TEST($)
-
This is a testing suite for the Meta::Types::Bool module. This test is should be run by a higher level management system at integration or release time or just as a regular routine to check that all is well. Currently this test just produces an object with one version and prints it out with another.
SUPER CLASSES
None.
BUGS
None.
AUTHOR
Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER
HISTORY
0.00 MV md5 issues
SEE ALSO
Error(3), strict(3)
TODO
Nothing.