NAME

Thrift::Parser::Type::Enum - Enum type

DESCRIPTION

METHODS

This class inherits from Thrift::Parser::Type; see docs there for inherited methods.

compose

Pass either a named element of the enumeration or an index:

my $value = $enum->compose('PHP');
my $value = $enum->compose('_4');

As you can see, the index is '_' + digits. Throws Thrift::Parser::InvalidArgument

new_from_id

Same as "compose" when called with '_' + digit.

new_from_name

Same as "compose" when called with an element name.

value_name

my $object = $enum->compose('PHP');
$object->value_name == 'PHP';

Returns the name of the element referenced by $self.

COPYRIGHT

Copyright (c) 2009 Eric Waters and XMission LLC (http://www.xmission.com/). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

AUTHOR

Eric Waters <ewaters@gmail.com>