From: Shawn M Moore Date: Tue, 17 Jun 2008 03:52:35 +0000 (+0000) Subject: Begin filling out role application X-Git-Tag: 0.19~297 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da0c885dc9a21cad4c372d28c1dd6ef0813cc0bd;p=gitmo%2FMouse.git Begin filling out role application --- diff --git a/lib/Mouse.pm b/lib/Mouse.pm index c6a7a2a..1f1e386 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -79,7 +79,7 @@ do { confess "Mouse::Role only supports 'with' on individual roles at a time" if @_; Mouse::load_class($role); - $role->meta->apply_to_class($class); + $role->meta->apply($class); }; }, ); diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 92b39c1..8e42641 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -34,6 +34,20 @@ sub name { $_[0]->{name} } sub has_attribute { exists $_[0]->{attributes}->{$_[1]} } sub add_attribute { $_[0]->{attributes}->{$_[1]} = $_[2] } +sub get_attribute_list { +} + +sub apply { + my $self = shift; + my $class = shift; + my $pkg = shift; + + for my $name ($self->get_attribute_list) { + my $attr = $self->get_attribute($name); + Mouse::Meta::Attribute->create($pkg, $name, $attr); + } + +} 1;