X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fslides%2Findex.html;h=e8302e4e73cbe636f765ed888232e74e28c1cd6d;hb=a88cc08084397dc7667e26dc315fb5492d8bf558;hp=802425fb21fefba3897223b36d1ed399f0ab8308;hpb=34b8c7482de09355b22545268b81d53654f66b2a;p=gitmo%2Fmoose-presentations.git diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index 802425f..e8302e4 100644 --- a/moose-class/slides/index.html +++ b/moose-class/slides/index.html @@ -950,10 +950,10 @@ sub BUILD {
@@ -1234,8 +1234,6 @@ use Moose; # perl bin/prove -lv t/00-prereq.t -# perl install-moose (if needed) - ## Read the instructions in t/01-classes.t # perl bin/prove -lv t/01-classes.t @@ -2017,7 +2015,7 @@ Person->new( shoes => Shoes->new );class_type
use Moose::Util::TypeConstraints;
-class_type 'DateTime';
+
+class_type 'DateTime';
+
+
subtype 'DateTime',
+
+subtype 'DateTime',
as 'Object',
where { $_->isa('DateTime') },
message { ... };
@@ -2616,11 +2618,15 @@ class_type 'DateTime';
role_type
use Moose::Util::TypeConstraints;
-role_type 'Printable';
+
+role_type 'Printable';
+
+
subtype 'Printable',
+
+subtype 'Printable',
as 'Object',
where
{ Moose::Util::does_role(
@@ -2632,11 +2638,15 @@ role_type 'Printable';
Subtype Shortcuts - duck_type
use Moose::Util::TypeConstraints;
-duck_type Car => qw( run break_down );
+
+duck_type Car => qw( run break_down );
+
+
subtype 'Car',
+
+subtype 'Car',
as 'Object',
where { all { $_->can($_) }
qw( run break_down ) },
@@ -2647,11 +2657,15 @@ duck_type Car => qw( run break_down );
Subtype Shortcuts - enum
use Moose::Util::TypeConstraints;
-enum Color => qw( red blue green );
+
+enum Color => qw( red blue green );
+
+
my %ok = map { $_ => 1 }
+
+my %ok = map { $_ => 1 }
qw( red blue green );
subtype 'Color'
@@ -2666,7 +2680,9 @@ subtype 'Color'
package Person;
my $posint =
- subtype as 'Int', where { $_ > 0 };
+ subtype
+ as 'Int',
+ where { $_ > 0 };
has size => (
is => 'ro',
@@ -2946,10 +2962,21 @@ has transaction_history => (
+
+
+
+
@@ -3263,7 +3313,7 @@ has history => (
package Person;
use Moose;
has _favorite_numbers => (
- traits => [ 'Array' ],
+ traits => [ 'Array' ],
isa => 'ArrayRef[Int]',
default => sub { [] },
init_arg => undef,
@@ -3342,82 +3392,6 @@ $person->account->deposit(100);
-
-
-
-
-
-
-
-
-
-
-
-
@@ -3658,12 +3631,13 @@ with HasCollection => { type => 'Int' };
- - Catalyst
- - CHI
- - Devel::REPL
- - Email::Sender
- - Fey
- - Net::Twitter
+ - Catalyst
+ - CHI
+ - Devel::REPL
+ - Dist::Zilla
+ - Email::Sender
+ - Fey
+ - Net::Twitter
@@ -3672,12 +3646,12 @@ with HasCollection => { type => 'Int' };
- http://moose.perl.org/
- - Moose::Manual and Moose::Cookbook
+ - Moose::Manual and Moose::Cookbook
- irc://irc.perl.org/#moose
- mailing list - moose@perl.org
- Slides and exercises are in Moose's git repo:
- git://jules.scsys.co.uk/gitmo/moose-presentations
+ git://git.moose.perl.org/moose-presentations.git
@@ -3691,7 +3665,7 @@ with HasCollection => { type => 'Int' };