Make delayed role conflict slightly more semantically sane
[gitmo/moose-presentations.git] / moose-class / slides / index.html
index 10766e6..979bbfa 100644 (file)
@@ -300,8 +300,8 @@ has blog_uri => (
     <span class="highlight">handles =&gt; { 'blog_host' =&gt; 'host' },</span>
 );
 
-<span class="highlight">$person->blog_host;</span>
-# really calls $person->blog_uri->host</code></pre>
+<span class="highlight">$person-&gt;blog_host;</span>
+# really calls $person-&gt;blog_uri-&gt;host</code></pre>
 </div>
 
 <div class="slide">
@@ -955,7 +955,7 @@ sub BUILD {
     <li>Calls <code>Person-&gt;BUILDARGS(@_)</code> to turn <code>@_</code> into a hashref</li>
     <li>Blesses a reference</li>
     <li>Populates attributes based on the hashref from #1</li>
-    <li>Calls <code>$new_object->BUILDALL($constructor_args)</code>
+    <li>Calls <code>$new_object-&gt;BUILDALL($constructor_args)</code>
         <br />... which calls all <code>BUILD</code> methods</li>    
     <li>Returns the object</li>
   </ol>
@@ -1127,7 +1127,7 @@ print $person-&gt;first_name; # Dave</code></pre>
 use Moose;
 
 # true
-Person->can('extends');</code></pre>
+Person-&gt;can('extends');</code></pre>
 
   <ul>
     <li>Not very hygienic</li>
@@ -1145,7 +1145,7 @@ use Moose;
 <span class="highlight">no Moose;</span>
 
 # false
-Person->can('extends');</code></pre>
+Person-&gt;can('extends');</code></pre>
 </div>
 
 <div class="slide">
@@ -1158,7 +1158,7 @@ use Moose;
 ...
 
 # false
-Person->can('extends');</code></pre>
+Person-&gt;can('extends');</code></pre>
 </div>
 
 <div class="slide">
@@ -1182,7 +1182,7 @@ Person->can('extends');</code></pre>
   <pre><code>package Person;
 use Moose;
 
-<span class="highlight">__PACKAGE__->meta->make_immutable;</span></code></pre>
+<span class="highlight">__PACKAGE__-&gt;meta-&gt;make_immutable;</span></code></pre>
 </div>
 
 <div class="slide">
@@ -1368,7 +1368,7 @@ sub print {
 
 # or ...
 
-Person-&gt;meta-&gt;does('Printable')</code></pre>
+Person-&gt;meta-&gt;does_role('Printable')</code></pre>
 
 </div>
 
@@ -1471,9 +1471,9 @@ use Moose;
 sub break {
     my $self = shift;
 
-    $self->break_it_down;
+    $self-&gt;break_it_down;
     if ( rand(1) &lt; 0.5 ) {
-        $self->break_bone;
+        $self-&gt;break_bone;
     }
 }</code></pre>
 </div>
@@ -1490,7 +1490,7 @@ sub break {
 </div>
 
 <div class="slide">
-  <h1>Hot Role-on-Role Action</h1>
+  <h1>Roles With Roles</h1>
 
   <pre><code>package Comparable;
 use Moose::Role;
@@ -1499,7 +1499,7 @@ requires 'compare';</code></pre>
 </div>
 
 <div class="slide">
-  <h1>Hot Role-on-Role Action</h1>
+  <h1>Roles With Roles</h1>
 
   <pre><code>package TestsEquality;
 use Moose::Role;
@@ -1508,7 +1508,7 @@ with 'Comparable';
 
 sub is_equal {
     my $self = shift;
-    return $self->compare(@_) == 0;
+    return $self-&gt;compare(@_) == 0;
 }</code></pre>
 </div>
 
@@ -1523,8 +1523,8 @@ with 'TestsEquality';
 # Satisfies the Comparable role
 sub compare { ... }
 
-Integer->does('TestsEquality'); # true
-Integer->does('Comparable'); # also true!</code></pre>
+Integer-&gt;does('TestsEquality'); # true
+Integer-&gt;does('Comparable'); # also true!</code></pre>
 </div>
 
 <div class="slide">
@@ -1546,11 +1546,11 @@ with 'HasSubProcess';
 <div class="slide">
   <h1>Delayed Conflict</h1>
 
-  <pre><code>package StateOfTexas;
+  <pre><code>package SysadminAssassin;
 with 'Killer';</code></pre>
 
   <ul>
-    <li><code>StateOfTexas</code> must implement its own <code>execute</code></li>
+    <li><code>SysadminAssassin</code> must implement its own <code>execute</code></li>
     <li>But loading the <code>Killer</code> role by itself does not cause an error</li>
   </ul>
 </div>
@@ -1631,7 +1631,7 @@ has [ 'left', 'right' ] => (
 
   <pre><code>use Moose::Util qw( apply_all_roles );
 
-my $fragile_person = Person->new( ... );
+my $fragile_person = Person-&gt;new( ... );
 apply_all_roles( $fragile_person,
                  'IsFragile' );</code></pre>
 
@@ -1787,8 +1787,8 @@ has first_name =&gt; (
     <span class="current incremental">required =&gt; 1,</span>
 );
 
-<span class="incremental">Person->new( first_name =&gt; undef ); # ok
-Person->new(); # kaboom</span></code></pre>
+<span class="incremental">Person-&gt;new( first_name =&gt; undef ); # ok
+Person-&gt;new(); # kaboom</span></code></pre>
 </div>
 
 <div class="slide">
@@ -2058,11 +2058,11 @@ has shoe_size => (
     <span class="highlight">init_arg =&gt; 'foot_size',</span>
 );
 
-Person->new( <span class="wrong">shoe_size =&gt; 13</span> );
+Person-&gt;new( <span class="wrong">shoe_size =&gt; 13</span> );
 
 my $person =
-    Person->new( <span class="right">foot_size =&gt; 13</span> );
-print $person->shoe_size;</code></pre>
+    Person-&gt;new( <span class="right">foot_size =&gt; 13</span> );
+print $person-&gt;shoe_size;</code></pre>
 </div>
 
 <div class="slide">
@@ -2076,7 +2076,7 @@ has shoes => (
     <span class="highlight">init_arg =&gt; undef,</span>
 );
 
-Person->new( <span class="wrong">shoes =&gt; Shoes-&gt;new</span> );</code></pre>
+Person-&gt;new( <span class="wrong">shoes =&gt; Shoes-&gt;new</span> );</code></pre>
 </div>
 
 <div class="slide">
@@ -2397,7 +2397,7 @@ after clear_password =&gt; sub {
         $self-&gt;$orig(
             $self-&gt;_munge_insert(@_) );
 
-    $new_user->_assign_uri;
+    $new_user-&gt;_assign_uri;
     return $new_user;
 };</code></pre>
 </div>
@@ -3732,7 +3732,7 @@ sub run { ... }</code></pre>
 
 use App::CLI;
 
-<span class="highlight">App::CLI->new_with_options()</span>->run();</code></pre>
+<span class="highlight">App::CLI-&gt;new_with_options()</span>-&gt;run();</code></pre>
 
 <pre>$ myapp-cli \
    --file foo \