Fix (or remove) broken links in the POD
[gitmo/Moose.git] / lib / Moose / Manual / FAQ.pod
index ec73df8..87315c1 100644 (file)
@@ -128,7 +128,7 @@ L<MooseX::SemiAffordanceAccessor>.
 
 NOTE: This B<cannot> be set globally in Moose, as that would break
 other classes which are built with Moose. You can still save on typing
-by defining a new L<MyApp::Moose> that exports Moose's sugar and then
+by defining a new C<MyApp::Moose> that exports Moose's sugar and then
 turns on L<MooseX::FollowPBP>. See
 L<Moose::Cookbook::Extending::Recipe4>.
 
@@ -363,6 +363,26 @@ Outside the context of Moose, traits and roles generally mean exactly
 the same thing. The original paper called them traits, but Perl 6
 will call them roles.
 
+=head3 Can an attribute-generated method (e.g. an accessor) satisfy requires?
+
+Yes, just be sure to consume the role I<after> declaring your
+attribute.  L<Moose::Manual::Roles/Required Attributes> provides
+an example:
+
+  package Breakable;
+  use Moose::Role;
+  requires 'stress';
+
+  package Car;
+  use Moose;
+  has 'stress' => ( is  => 'rw', isa => 'Int' );
+  with 'Breakable';
+
+If you mistakenly consume the C<Breakable> role before declaring your
+C<stress> attribute, you would see an error like this:
+
+  'Breakable' requires the method 'stress' to be implemented by 'Car' at...
+
 =head2 Moose and Subroutine Attributes
 
 =head3 Why don't subroutine attributes I inherited from a superclass work?