From: Shawn M Moore Date: Wed, 4 Jun 2008 04:02:52 +0000 (+0000) Subject: isa -> type_constraint X-Git-Tag: 0.04~98 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=186657a92e5f7f1466dfdc7928f84be2f4c0ece1;p=gitmo%2FMouse.git isa -> type_constraint --- diff --git a/lib/Mouse/Attribute.pm b/lib/Mouse/Attribute.pm index 325c24d..22e86e0 100644 --- a/lib/Mouse/Attribute.pm +++ b/lib/Mouse/Attribute.pm @@ -16,14 +16,15 @@ sub new { bless \%args, $class; } -sub name { $_[0]->{name} } -sub class { $_[0]->{class} } -sub default { $_[0]->{default} } -sub predicate { $_[0]->{predicate} } -sub clearer { $_[0]->{clearer} } -sub handles { $_[0]->{handles} } -sub weak_ref { $_[0]->{weak_ref} } -sub init_arg { $_[0]->{init_arg} } +sub name { $_[0]->{name} } +sub class { $_[0]->{class} } +sub default { $_[0]->{default} } +sub predicate { $_[0]->{predicate} } +sub clearer { $_[0]->{clearer} } +sub handles { $_[0]->{handles} } +sub weak_ref { $_[0]->{weak_ref} } +sub init_arg { $_[0]->{init_arg} } +sub type_constraint { $_[0]->{type_constraint} } sub generate_accessor { my $attribute = shift; @@ -125,6 +126,8 @@ sub create { if exists($args{handles}) && ref($args{handles}) ne 'HASH'; + $args{type_constraint} = delete $args{isa}; + my $attribute = $self->new(%args, name => $name, class => $class); my $meta = $class->meta;