Use Mouse::Object::BUILDARGS, because it's safe and flexible.
[gitmo/Mouse.git] / lib / Mouse / Meta / Role / Composite.pm
index 02a0510..18745d5 100644 (file)
@@ -50,7 +50,9 @@ sub has_override_method_modifier{
 }
 
 sub add_attribute{
-    my($self, $attr_name, $spec) = @_;
+    my $self      = shift;
+    my $attr_name = shift;
+    my $spec      = (@_ == 1 ? $_[0] : {@_});
 
     my $existing = $self->{attributes}{$attr_name};
     if($existing && $existing != $spec){
@@ -114,3 +116,16 @@ sub _apply_methods{
 1;
 __END__
 
+=head1 NAME
+
+Mouse::Meta::Role::Composite - An object to represent the set of roles
+
+=head1 VERSION
+
+This document describes Mouse version 0.47
+
+=head1 SEE ALSO
+
+L<Moose::Meta::Role::Composite>
+
+=cut