X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fslides%2Findex.html;h=979bbfa1c67af03fa3cc230f7f443bd2af009153;hb=9b515ca454467f3399fadd456b7ed0945b30d618;hp=10766e66d691828549ff8fef6700dd2408b0e311;hpb=511c92348bfa42fc4f700c2faf92a851b44654b2;p=gitmo%2Fmoose-presentations.git
diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html
index 10766e6..979bbfa 100644
--- a/moose-class/slides/index.html
+++ b/moose-class/slides/index.html
@@ -300,8 +300,8 @@ has blog_uri => (
handles => { 'blog_host' => 'host' },
);
-$person->blog_host;
-# really calls $person->blog_uri->host
+$person->blog_host;
+# really calls $person->blog_uri->host
@@ -955,7 +955,7 @@ sub BUILD {
Calls Person->BUILDARGS(@_)
to turn @_
into a hashref
Blesses a reference
Populates attributes based on the hashref from #1
-
Calls $new_object->BUILDALL($constructor_args)
+ Calls $new_object->BUILDALL($constructor_args)
... which calls all BUILD
methods
Returns the object
@@ -1127,7 +1127,7 @@ print $person->first_name; # Dave
use Moose;
# true
-Person->can('extends');
+Person->can('extends');
- Not very hygienic
@@ -1145,7 +1145,7 @@ use Moose;
no Moose;
# false
-Person->can('extends');
+Person->can('extends');
@@ -1158,7 +1158,7 @@ use Moose;
...
# false
-Person->can('extends');
+Person->can('extends');
@@ -1182,7 +1182,7 @@ Person->can('extends');
package Person;
use Moose;
-__PACKAGE__->meta->make_immutable;
+
__PACKAGE__->meta->make_immutable;
@@ -1368,7 +1368,7 @@ sub print {
# or ...
-Person->meta->does('Printable')
+Person->meta->does_role('Printable')
@@ -1471,9 +1471,9 @@ use Moose;
sub break {
my $self = shift;
- $self->break_it_down;
+ $self->break_it_down;
if ( rand(1) < 0.5 ) {
- $self->break_bone;
+ $self->break_bone;
}
}
@@ -1490,7 +1490,7 @@ sub break {
-
Hot Role-on-Role Action
+
Roles With Roles
package Comparable;
use Moose::Role;
@@ -1499,7 +1499,7 @@ requires 'compare';
-
Hot Role-on-Role Action
+
Roles With Roles
package TestsEquality;
use Moose::Role;
@@ -1508,7 +1508,7 @@ with 'Comparable';
sub is_equal {
my $self = shift;
- return $self->compare(@_) == 0;
+ return $self->compare(@_) == 0;
}
@@ -1523,8 +1523,8 @@ with 'TestsEquality';
# Satisfies the Comparable role
sub compare { ... }
-Integer->does('TestsEquality'); # true
-Integer->does('Comparable'); # also true!
+Integer->does('TestsEquality'); # true
+Integer->does('Comparable'); # also true!
@@ -1546,11 +1546,11 @@ with 'HasSubProcess';
Delayed Conflict
-
package StateOfTexas;
+ package SysadminAssassin;
with 'Killer';
- StateOfTexas
must implement its own execute
+ SysadminAssassin
must implement its own execute
- But loading the
Killer
role by itself does not cause an error
@@ -1631,7 +1631,7 @@ has [ 'left', 'right' ] => (
use Moose::Util qw( apply_all_roles );
-my $fragile_person = Person->new( ... );
+my $fragile_person = Person->new( ... );
apply_all_roles( $fragile_person,
'IsFragile' );
@@ -1787,8 +1787,8 @@ has first_name => (
required => 1,
);
-
Person->new( first_name => undef ); # ok
-Person->new(); # kaboom
+
Person->new( first_name => undef ); # ok
+Person->new(); # kaboom
@@ -2058,11 +2058,11 @@ has shoe_size => (
init_arg => 'foot_size',
);
-Person->new( shoe_size => 13 );
+Person->new( shoe_size => 13 );
my $person =
- Person->new( foot_size => 13 );
-print $person->shoe_size;
+ Person->new( foot_size => 13 );
+print $person->shoe_size;
@@ -2076,7 +2076,7 @@ has shoes => (
init_arg => undef,
);
-Person->new( shoes => Shoes->new );
+Person->new( shoes => Shoes->new );
@@ -2397,7 +2397,7 @@ after clear_password => sub {
$self->$orig(
$self->_munge_insert(@_) );
- $new_user->_assign_uri;
+ $new_user->_assign_uri;
return $new_user;
};
@@ -3732,7 +3732,7 @@ sub run { ... }
use App::CLI;
-App::CLI->new_with_options()->run();
+App::CLI->new_with_options()->run();
$ myapp-cli \
--file foo \