1Type::Tiny::Role(3) User Contributed Perl Documentation Type::Tiny::Role(3)
2
3
4
6 Type::Tiny::Role - type constraints based on the "DOES" method
7
9 This module is covered by the Type-Tiny stability policy.
10
12 Type constraints of the general form "{ $_->DOES("Some::Role") }".
13
14 This package inherits from Type::Tiny; see that for most documentation.
15 Major differences are listed below:
16
17 Attributes
18 "role"
19 The role for the constraint.
20
21 Note that this package doesn't subscribe to any particular flavour
22 of roles (Moose::Role, Mouse::Role, Moo::Role, Role::Tiny, etc). It
23 simply trusts the object's "DOES" method (see UNIVERSAL).
24
25 "constraint"
26 Unlike Type::Tiny, you cannot pass a constraint coderef to the
27 constructor. Instead rely on the default.
28
29 "inlined"
30 Unlike Type::Tiny, you cannot pass an inlining coderef to the
31 constructor. Instead rely on the default.
32
33 "parent"
34 Parent is always Types::Standard::Object, and cannot be passed to
35 the constructor.
36
37 Methods
38 "stringifies_to($constraint)"
39 See Type::Tiny::ConstrainedObject.
40
41 "numifies_to($constraint)"
42 See Type::Tiny::ConstrainedObject.
43
44 "with_attribute_values($attr1 => $constraint1, ...)"
45 See Type::Tiny::ConstrainedObject.
46
48 Please report any bugs to
49 <http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny>.
50
52 Type::Tiny::Manual.
53
54 Type::Tiny.
55
56 Moose::Meta::TypeConstraint::Role.
57
59 Toby Inkster <tobyink@cpan.org>.
60
62 This software is copyright (c) 2013-2014, 2017-2020 by Toby Inkster.
63
64 This is free software; you can redistribute it and/or modify it under
65 the same terms as the Perl 5 programming language system itself.
66
68 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
69 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
70 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
71
72
73
74perl v5.32.0 2020-09-17 Type::Tiny::Role(3)