| 1 | 16 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 16 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | package MooseX::Types::Moose; | ||
| 4 | # ABSTRACT: Type exports that match the types shipped with L<Moose> | ||
| 5 | |||
| 6 | 16 | our $VERSION = '0.51'; | |
| 7 | |||
| 8 | 16 | ▶ | use MooseX::Types; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 16 | ▶ | use Moose::Util::TypeConstraints (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 16 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | #pod =head1 SYNOPSIS | ||
| 14 | #pod | ||
| 15 | #pod package Foo; | ||
| 16 | #pod use Moose; | ||
| 17 | #pod use MooseX::Types::Moose qw( ArrayRef Int Str ); | ||
| 18 | #pod use Carp qw( croak ); | ||
| 19 | #pod | ||
| 20 | #pod has 'name', | ||
| 21 | #pod is => 'rw', | ||
| 22 | #pod isa => Str; | ||
| 23 | #pod | ||
| 24 | #pod has 'ids', | ||
| 25 | #pod is => 'rw', | ||
| 26 | #pod isa => ArrayRef[Int]; | ||
| 27 | #pod | ||
| 28 | #pod sub add { | ||
| 29 | #pod my ($self, $x, $y) = @_; | ||
| 30 | #pod croak 'First arg not an Int' unless is_Int($x); | ||
| 31 | #pod croak 'Second arg not an Int' unless is_Int($y); | ||
| 32 | #pod return $x + $y; | ||
| 33 | #pod } | ||
| 34 | #pod | ||
| 35 | #pod 1; | ||
| 36 | #pod | ||
| 37 | #pod =head1 DESCRIPTION | ||
| 38 | #pod | ||
| 39 | #pod This package contains a virtual library for L<MooseX::Types> that | ||
| 40 | #pod is able to export all types known to L<Moose>. See L<MooseX::Types> | ||
| 41 | #pod for general usage information. | ||
| 42 | #pod | ||
| 43 | #pod =cut | ||
| 44 | |||
| 45 | # all available builtin types as short and long name | ||
| 46 | my %BuiltIn_Storage | ||
| 47 | 16 | = map { ($_) x 2 } | |
| 48 | Moose::Util::TypeConstraints->list_all_builtin_type_constraints; | ||
| 49 | |||
| 50 | #pod =head1 METHODS | ||
| 51 | #pod | ||
| 52 | #pod =head2 type_storage | ||
| 53 | #pod | ||
| 54 | #pod Overrides L<MooseX::Types::Base>' C<type_storage> to provide a hash | ||
| 55 | #pod reference containing all built-in L<Moose> types. | ||
| 56 | #pod | ||
| 57 | #pod =cut | ||
| 58 | |||
| 59 | # use prepopulated builtin hash as type storage | ||
| 60 | 1033 | ▶ | sub type_storage { \%BuiltIn_Storage } |
|
Subroutine
type_storage: called CC=1 SCAR=0.0
Pod
documented
| |||
| 61 | |||
| 62 | #pod =head1 SEE ALSO | ||
| 63 | #pod | ||
| 64 | #pod L<Moose>, | ||
| 65 | #pod L<Moose::Util::TypeConstraints> | ||
| 66 | #pod | ||
| 67 | #pod =cut | ||
| 68 | |||
| 69 | 16 | 1; | |
| 70 | |||
| 71 | __END__ | ||