Object::Relation::Meta::Type 0.1.0 review

Download
by rbytes.net on

Object::Relation::Meta::Type is an Object::Relation Data type validation and accessor building. Synopsis Object::Relation::Me

License: Perl Artistic License
File size: 237K
Developer: Kineticode, Inc.
0 stars award from rbytes.net

Object::Relation::Meta::Type is an Object::Relation Data type validation and accessor building.

Synopsis

Object::Relation::Meta::Type->add(
key => "state",
name => "State",
builder => 'Object::Relation::Meta::AccessorBuilder',
raw => sub { ref $_[0] ? shift->value : shift },
store_raw => sub { shift->store_value },
check => sub {
UNIVERSAL::isa($_[0], 'Object::Relation::DataType::State')
or throw_invalid(['Value "[_1]" is not a valid [_2] object',
$_[0], 'Object::Relation::DataType::State']);
throw_invalid(['Cannot assign permanent state'])
if $_[0] == Object::Relation::DataType::State->PERMANENT;
}
);

This class subclasses Class::Meta::Type to provide additional attributes. These attributes can optionally be set via the call to new(), and may be fetched via their accessors.

Requirements:
Perl

Object::Relation::Meta::Type 0.1.0 keywords