Slide 75
Slide 75 text
package User;
use MyWeb::OO;
use MyWeb::OO::Persistent;
use MyWeb::OO::RESTful;
use MyWeb::OO::IncludeInAdminUI;
use MyWeb::OO::SpamTarget;
database_name ‘person’; # legacy
has email => (
is => ‘rw’,
isa => ‘Str’,
field_type => ‘text’,
spam_this => 1,
admin_editable => 0,
primary_key => 1,
);
75
Tuesday, June 23, 2009
Another important point of Moose::Util::MetaRole is that it composes with other extensions
seamlessly. You could write all of these Moose extensions that inject all sorts of roles into the
various metaclasses. For example, Persistent would inject both class and attribute roles, and
provide a database_name keyword.