Commit | Line | Data |
9a491c80 |
1 | package MooseX::Meta::TypeConstraint::Role::Structured; |
2 | |
3 | use Moose::Role; |
9a491c80 |
4 | |
5 | =head1 NAME |
6 | |
7 | MooseX::Meta::TypeConstraint::Role::Structured - Structured Type Constraints |
8 | |
9 | =head1 VERSION |
10 | |
11 | 0.01 |
12 | |
13 | =cut |
14 | |
15 | our $VERSION = '0.01'; |
16 | |
17 | =head1 DESCRIPTION |
18 | |
bc5c0758 |
19 | STUB - TBD |
9a491c80 |
20 | |
21 | =head1 ATTRIBUTES |
22 | |
23 | This class defines the following attributes. |
24 | |
25 | =head2 signature |
26 | |
27 | This is a signature of internal contraints for the contents of the outer |
28 | contraint container. |
29 | |
30 | =cut |
31 | |
32 | has 'signature' => ( |
33 | is=>'ro', |
bc5c0758 |
34 | isa=>'Ref', |
9a491c80 |
35 | required=>1, |
36 | ); |
37 | |
24dd1d2e |
38 | =head2 optional_signature |
39 | |
40 | This is a signature of internal contraints for the contents of the outer |
41 | contraint container. These are optional constraints. |
42 | |
43 | =cut |
44 | |
45 | has 'optional_signature' => ( |
46 | is=>'ro', |
47 | isa=>'Ref', |
48 | predicate=>'has_optional_signature', |
49 | ); |
50 | |
9a491c80 |
51 | =head1 METHODS |
52 | |
53 | This class defines the following methods. |
54 | |
55 | =head2 _normalize_args |
56 | |
57 | Get arguments into a known state or die trying. Ideally we try to make this |
58 | into a HashRef so we can match it up with the L</signature> HashRef. |
59 | |
60 | =cut |
61 | |
9a491c80 |
62 | |
63 | =head2 constraint |
64 | |
65 | The constraint is basically validating the L</signature> against the incoming |
66 | |
67 | =cut |
68 | |
9a491c80 |
69 | =head2 equals |
70 | |
71 | modifier to make sure equals descends into the L</signature> |
72 | |
73 | =cut |
74 | |
9a491c80 |
75 | =head2 signature_equals |
76 | |
77 | Check that the signature equals another signature. |
78 | |
79 | =cut |
80 | |
9a491c80 |
81 | =head1 AUTHOR |
82 | |
83 | John James Napiorkowski <jjnapiork@cpan.org> |
84 | |
85 | =head1 LICENSE |
86 | |
87 | You may distribute this code under the same terms as Perl itself. |
88 | |
89 | =cut |
90 | |
bc5c0758 |
91 | 1; |