X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse.pm;h=a12c4a94e9d0198e03706ec36583326f8060a62e;hp=877fc6ff7a9e0856155cc72593ff3131f26fd650;hb=0126c27c413cb63f67e66e09b0fdfeb92117503a;hpb=4352306000f5015a5984891845a5016fa7c831a4 diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 877fc6f..a12c4a9 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -3,7 +3,7 @@ use 5.006_002; use Mouse::Exporter; # enables strict and warnings -our $VERSION = '0.37_02'; +our $VERSION = '0.37_04'; use Carp qw(confess); use Scalar::Util qw(blessed); @@ -46,6 +46,9 @@ sub has { my $meta = Mouse::Meta::Class->initialize(scalar caller); my $name = shift; + $meta->throw_error(q{Usage: has 'name' => ( key => value, ... )}) + if @_ % 2; # odd number of arguments + $meta->add_attribute($_ => @_) for ref($name) ? @{$name} : $name; } @@ -148,7 +151,6 @@ sub init_meta { 1; - __END__ =head1 NAME