<h1>Subtype Shortcuts - <code>class_type</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-class_type 'DateTime';</code></pre>
+
+class_type 'DateTime';
+
+</code></pre>
<hr />
-<pre><code>subtype 'DateTime',
+<pre><code>
+subtype 'DateTime',
as 'Object',
where { $_->isa('DateTime') },
message { ... };</code></pre>
<h1>Subtype Shortcuts - <code>role_type</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-role_type 'Printable';</code></pre>
+
+role_type 'Printable';
+
+</code></pre>
<hr />
-<pre><code>subtype 'Printable',
+<pre><code>
+subtype 'Printable',
as 'Object',
where
{ Moose::Util::does_role(
<h1>Subtype Shortcuts - <code>duck_type</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-duck_type Car => qw( run break_down );</code></pre>
+
+duck_type Car => qw( run break_down );
+
+</code></pre>
<hr />
-<pre><code>subtype 'Car',
+<pre><code>
+subtype 'Car',
as 'Object',
where { all { $_->can($_) }
qw( run break_down ) },
<h1>Subtype Shortcuts - <code>enum</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-enum Color => qw( red blue green );</code></pre>
+
+enum Color => qw( red blue green );
+
+</code></pre>
<hr />
-<pre><code>my %ok = map { $_ => 1 }
+<pre><code>
+my %ok = map { $_ => 1 }
qw( red blue green );
subtype 'Color'
<pre><code>package Person;
<span class="highlight">my $posint =
- subtype as 'Int', where { $_ > 0 };</span>
+ subtype
+ as 'Int',
+ where { $_ > 0 };</span>
has size => (
is => 'ro',