Doc for some of the new meta methods
[gitmo/Mouse.git] / lib / Mouse / Meta / Attribute.pm
index 4791dab..af9e737 100644 (file)
@@ -22,14 +22,15 @@ sub new {
             if exists $args{default};
         $args{lazy}      = 1;
         $args{required}  = 1;
-        $args{builder} ||= "_build_${name}";
+        $args{builder}   = "_build_${name}"
+            if !exists($args{builder});
         if ($name =~ /^_/) {
-            $args{clearer}   ||= "_clear${name}";
-            $args{predicate} ||= "_has${name}";
-        } 
+            $args{clearer}   = "_clear${name}" if !exists($args{clearer});
+            $args{predicate} = "_has${name}" if !exists($args{predicate});
+        }
         else {
-            $args{clearer}   ||= "clear_${name}";
-            $args{predicate} ||= "has_${name}";
+            $args{clearer}   = "clear_${name}" if !exists($args{clearer});
+            $args{predicate} = "has_${name}" if !exists($args{predicate});
         }
     }
 
@@ -402,5 +403,15 @@ this attribute's type constraint;
 Checks that the given value passes this attribute's type constraint. Returns 1
 on success, otherwise C<confess>es.
 
+=head2 clone_parent OwnerClass, AttributeName, %args -> Mouse::Meta::Attribute
+
+Creates a new attribute in OwnerClass, inheriting options from parent classes.
+Accessors and helper methods are installed. Some error checking is done.
+
+=head2 get_parent_args OwnerClass, AttributeName -> Hash
+
+Returns the options that the parent class of C<OwnerClass> used for attribute
+C<AttributeName>.
+
 =cut