Class::Value::Enum - An enumeration value object
This is a value object that only takes one of a given list of values. See Class::Value::Boolean for an example.
Returns the denormalized value, that is, the value that would be normalized to the currently set value. This obviously only works well if there is a one-to-one relationships between denormalized and normalized values. If this is not the case for your specific enumeration value object, then override this method.
Returns the list of values that this value object will accept. In this base class, the empty list is returned, so you will need to override it in subclasses.
Returns a hash reference that shows how to normalize values. For each hash entry, the key is the denormalized value and the value is the normalized value. See Class::Value::Boolean for an example. In this base class, an empty hash reference is returned, so you will need to override it in subclasses.
Normalizes the given value.
If the argument is one of the values this value object can take according to
get_valid_values_list() - the result of which are cached for performance reasons -,
then it is returned unaltered,
get_value_normalization_hashref() is consulted.
Hands over normalization to
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Class-Value.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Class-Value/.
The development version lives at http://github.com/hanekomu/Class-Value/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <email@example.com>
This software is copyright (c) 2004 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.