| Meta documentation | view source | Contained in the Meta distribution. |
Meta::Types::Bool - an object oriented boolean type.
Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.
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.
MANIFEST: Bool.pm PROJECT: meta VERSION: 0.00
package foo; use Meta::Types::Bool qw(); my($object)=Meta::Types::Bool->new(); my($result)=$object->method();
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 :
new($) new_value($$) set_value($$) get_value($) new_version($$$) set_version($$$) get_version($$) not($) TEST($)
This is a constructor for the Meta::Types::Bool object. By default the value of it is 1 (true).
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.
Give this method a value and it will set the internal value of the boolean according to whether your value evaluates to true.
This method retrieves the current value of the boolean.
Pass a value and a version to this constructor and it will give you an object with the internal value stored accordingly.
Pass a version and value to this method and it will set the internal boolean value accordingly.
Pass a version to this method and you will get the boolean value converted to this version.
This method will perform a boolean NOT operation on the value stored.
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.
None.
None.
Name: Mark Veltzer Email: mailto:veltzer@cpan.org WWW: http://www.veltzer.org CPAN id: VELTZER
0.00 MV md5 issues
Error(3), strict(3)
Nothing.
| Meta documentation | view source | Contained in the Meta distribution. |