From: Jesse Luehrs Date: Sat, 7 May 2011 07:21:31 +0000 (-0500) Subject: typo fixes X-Git-Tag: 2.0003~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e00fa64c84f02741870a53e8da725768831fd4a7;p=gitmo%2FMoose.git typo fixes --- diff --git a/lib/Moose/Cookbook/Basics/Recipe5.pod b/lib/Moose/Cookbook/Basics/Recipe5.pod index c8f457c..46acef4 100644 --- a/lib/Moose/Cookbook/Basics/Recipe5.pod +++ b/lib/Moose/Cookbook/Basics/Recipe5.pod @@ -76,7 +76,7 @@ First, we create the subtype to which we will coerce the other types: subtype 'My::Types::HTTP::Headers' => as class_type('HTTP::Headers'); We are creating a subtype rather than using C as a type -directly. The reason we do this is coercions are global, and a +directly. The reason we do this is that coercions are global, and a coercion defined for C in our C class would then be defined for I Moose-using classes in the current Perl interpreter. It's a L to @@ -96,7 +96,7 @@ We could go ahead and use this new type directly: has 'headers' => ( is => 'rw', - isa => 'HTTP::Headers', + isa => 'My::Types::HTTP::Headers', default => sub { HTTP::Headers->new } ); @@ -106,7 +106,7 @@ L. The constructor for L accepts a list of key-value pairs representing the HTTP header fields. In Perl, such a list could be stored in an ARRAY or HASH reference. We want our C attribute -to accept those data structure instead of an B +to accept those data structures instead of an B instance, and just do the right thing. This is exactly what coercion is for: @@ -170,7 +170,7 @@ return value. If L didn't return a L object (for whatever reason), Moose would throw a type constraint error. -The other coercion takes a string and converts to a L. In this +The other coercion takes a string and converts it to a L. In this case, we are using the coercion to apply a default behavior, where a string is assumed to be an C URI. @@ -190,7 +190,7 @@ caution. Sometimes it's better to reject a value than just guess at how to DWIM. We also showed the use of the C sugar function as a -shortcut for defining a new subtype of C +shortcut for defining a new subtype of C. =head1 FOOTNOTES @@ -201,7 +201,7 @@ shortcut for defining a new subtype of C This particular example could be safer. Really we only want to coerce an array with an I number of elements. We could create a new C type, and then coerce from that type, as -opposed to from a plain C +opposed to a plain C =back