X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fslides%2Findex.html;h=6e8415c7dadaff7ba8bdb2d8661bb3c394683371;hb=1a2103f568e2d2b2522685fe814263f63dce3223;hp=5b91f02bc10e56ade38552aedf00d5f9b40c69eb;hpb=8ba9682918eeec2fae54d1ad72cf2b4e0f85fc9e;p=gitmo%2Fmoose-presentations.git diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index 5b91f02..6e8415c 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');
    @@ -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;
    @@ -1348,9 +1348,7 @@ use Moose; with 'Printable'; -die '...' unless __PACKAGE__->can('as_string'); - -has has_been_printed => ( is => 'rw' ); +has has_been_printed => ( is => 'rw' ); sub print { my $self = shift; @@ -1370,7 +1368,7 @@ sub print { # or ... -Person->meta->does('Printable') +Person->meta->does_role('Printable')
    @@ -1473,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; } } @@ -1492,7 +1490,7 @@ sub break {
    -

    Hot Role-on-Role Action

    +

    Roles With Roles

    package Comparable;
     use Moose::Role;
    @@ -1501,7 +1499,7 @@ requires 'compare';
    -

    Hot Role-on-Role Action

    +

    Roles With Roles

    package TestsEquality;
     use Moose::Role;
    @@ -1510,7 +1508,7 @@ with 'Comparable';
     
     sub is_equal {
         my $self = shift;
    -    return $self->compare(@_) == 0;
    +    return $self->compare(@_) == 0;
     }
    @@ -1525,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!
    @@ -1633,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' );
    @@ -1789,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
    @@ -2060,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;
    @@ -2078,7 +2076,7 @@ has shoes => ( init_arg => undef, ); -Person->new( shoes => Shoes->new ); +Person->new( shoes => Shoes->new );
    @@ -2399,7 +2397,7 @@ after clear_password => sub { $self->$orig( $self->_munge_insert(@_) ); - $new_user->_assign_uri; + $new_user->_assign_uri; return $new_user; };
    @@ -3734,7 +3732,7 @@ sub run { ... } use App::CLI; -App::CLI->new_with_options()->run(); +App::CLI->new_with_options()->run();
    $ myapp-cli \
        --file foo \