Marcel Grünauer > Class-Value-1.100840 > Class::Value::Enum

Download:
Class-Value-1.100840.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.100840   Source  

NAME ^

Class::Value::Enum - An enumeration value object

VERSION ^

version 1.100840

DESCRIPTION ^

This is a value object that only takes one of a given list of values. See Class::Value::Boolean for an example.

METHODS ^

as_plaintext

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.

get_valid_values_list

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.

get_value_normalization_hashref

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.

normalize_enum_value

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, otherwise get_value_normalization_hashref() is consulted.

normalize_value

Hands over normalization to normalize_enum_value.

INSTALLATION ^

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS ^

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.

AVAILABILITY ^

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.

AUTHOR ^

  Marcel Gruenauer <marcel@cpan.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: