From: Dave Rolsky Date: Fri, 11 Sep 2009 21:09:17 +0000 (-0500) Subject: Lots of slide tweaks to work nicely on my 1024x768 laptop X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=debc93f8ce3e39764395e2eb15da98465c9447b3;p=gitmo%2Fmoose-presentations.git Lots of slide tweaks to work nicely on my 1024x768 laptop Some html fixes and minor text tweaks Added the CC image so we don't need a live net connection to display it --- diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index 09cec1e..e1e1445 100644 --- a/moose-class/slides/index.html +++ b/moose-class/slides/index.html @@ -40,7 +40,7 @@ img#me05 {top: 43px;left: 36px;} @@ -284,10 +287,10 @@ use Moose; has blog_uri => ( is => 'rw', isa => 'URI', - handles => { 'blog_hostname' => 'host' }, + handles => { 'blog_host' => 'host' }, ); -$person->blog_hostname; +$person->blog_host; # really calls $person->blog_uri->host @@ -296,7 +299,7 @@ has blog_uri => ( @@ -888,7 +891,6 @@ sub BUILDARGS { if ( @_ == 1 && ! ref $_[0] ) { return { ssn => $_[0] }; } - return $class->SUPER::BUILDARGS(@_); } @@ -1029,7 +1031,8 @@ use Moose; override work => sub { my $self = shift; - die "Pay me first" unless $self->got_paid; + die "Pay me first" + unless $self->got_paid; super(); }; @@ -1127,7 +1130,7 @@ Person->can('extends'); @@ -1212,11 +1215,10 @@ Iterate til this passes all its tests
-

Roles Can Have State and Behavior

+

Roles - State and Behavior

package HasPermissions;
 use Moose::Role;
-
 # state
 has access_level => ( is => 'rw' );
 
@@ -1225,7 +1227,8 @@ sub can_access {
     my $self     = shift;
     my $required = shift;
 
-    return $self->access_level >= $required;
+    return $self->access_level
+             >= $required;
 }
@@ -1269,8 +1272,8 @@ with 'HasPermissions';

Classes Consume Roles

my $person = Person->new(
-    first_name => 'Kenichi',
-    last_name => 'Asai',
+    first_name   => 'Kenichi',
+    last_name    => 'Asai',
     access_level => 42,
 );
 
@@ -1326,7 +1329,7 @@ sub print {
 
 # or ...
 
-if ( Person->meta->does('Printable') ) { ... }
+Person->meta->does('Printable') @@ -1392,10 +1395,10 @@ use Moose; use Moose; with 'IsFragile' => - { alias => + { -alias => { break => 'break_bone' } }, 'CanBreakdance' => - { alias => + { -alias => { break => 'break_it_down' } };