README
1NAME
2
3 MooseX::Meta::TypeConstraint::Mooish - Translate Moo-style constraints
4 to Moose-style
5
6VERSION
7
8 This document describes version 0.001 of
9 MooseX::Meta::TypeConstraint::Mooish - released March 12, 2015 as part
10 of MooseX-Meta-TypeConstraint-Mooish.
11
12SYNOPSIS
13
14 # easiest is via AttributeShortcuts
15 use MooseX::AttributeShortcuts 0.028;
16
17 has foo => (
18 is => 'rw',
19 isa => sub { die unless $_[0] == 5 },
20 );
21
22 # or, the hard way
23 use MooseX::Meta::TypeConstraint::Mooish;
24
25 has foo => (
26 is => 'rw',
27 isa => MooseX::Meta::TypeConstraint::Mooish->new(
28 constraint => sub { die unless $_[0] == 5 },
29 ),
30 );
31
32DESCRIPTION
33
34 Moose type constraints are expected to return true if the value passes
35 the constraint, and false otherwise; Moo "constraints", on the other
36 hand, die if validation fails.
37
38 This metaclass allows for Moo-style constraints; it will wrap them and
39 translate their Moo into a dialect Moose understands.
40
41 Note that this is largely to enable functionality in
42 MooseX::AttributeShortcuts; the easiest way use this metaclass is by
43 using that package. Also, as it's not inconceivable that this
44 functionality may be desired in other constraint metaclasses, the bulk
45 of this metaclass' functionality is implemented as a trait.
46
47SEE ALSO
48
49 Please see those modules/websites for more information related to this
50 module.
51
52 * MooseX::AttributeShortcuts
53
54 * MooseX::TraitFor::Meta::TypeConstraint::Mooish
55
56SOURCE
57
58 The development version is on github at
59 http://https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish
60 and may be cloned from
61 git://https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish.git
62
63BUGS
64
65 Please report any bugs or feature requests on the bugtracker website
66 https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish/issues
67
68 When submitting a bug or request, please include a test-file or a patch
69 to an existing test-file that illustrates the bug or desired feature.
70
71AUTHOR
72
73 Chris Weyl <cweyl@alumni.drew.edu>
74
75 I'm a material boy in a material world
76
77 Please note I do not expect to be gittip'ed or flattr'ed for this work,
78 rather it is simply a very pleasant surprise. I largely create and
79 release works like this because I need them or I find it enjoyable;
80 however, don't let that stop you if you feel like it ;)
81
82 Flattr this
83 <https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-meta-typeconstraint-mooish&title=RsrchBoy's%20CPAN%20MooseX-Meta-TypeConstraint-Mooish&tags=%22RsrchBoy's%20MooseX-Meta-TypeConstraint-Mooish%20in%20the%20CPAN%22>,
84 gittip me <https://www.gittip.com/RsrchBoy/>, or indulge my Amazon
85 Wishlist <http://bit.ly/rsrchboys-wishlist>... If you so desire.
86
87COPYRIGHT AND LICENSE
88
89 This software is Copyright (c) 2015 by Chris Weyl.
90
91 This is free software, licensed under:
92
93 The GNU Lesser General Public License, Version 2.1, February 1999
94
95