1Type::Tiny::Role(3)   User Contributed Perl Documentation  Type::Tiny::Role(3)
2
3
4

NAME

6       Type::Tiny::Role - type constraints based on the "DOES" method
7

STATUS

9       This module is covered by the Type-Tiny stability policy.
10

DESCRIPTION

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
47   Exports
48       Type::Tiny::Role can be used as an exporter.
49
50         use Type::Tiny::Role 'MyApp::Printable';
51
52       This will export the following functions into your namespace:
53
54       "MyAppPrintable"
55       "is_MyAppPrintable( $value )"
56       "assert_MyAppPrintable( $value )"
57       "to_MyAppPrintable( $value )"
58
59       Multiple types can be exported at once:
60
61         use Type::Tiny::Role qw( MyApp::Printable MyApp::Sendable );
62

BUGS

64       Please report any bugs to
65       <https://github.com/tobyink/p5-type-tiny/issues>.
66

SEE ALSO

68       Type::Tiny::Manual.
69
70       Type::Tiny.
71
72       Moose::Meta::TypeConstraint::Role.
73

AUTHOR

75       Toby Inkster <tobyink@cpan.org>.
76
78       This software is copyright (c) 2013-2014, 2017-2023 by Toby Inkster.
79
80       This is free software; you can redistribute it and/or modify it under
81       the same terms as the Perl 5 programming language system itself.
82

DISCLAIMER OF WARRANTIES

84       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
85       WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
86       MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
87
88
89
90perl v5.36.0                      2023-01-04               Type::Tiny::Role(3)
Impressum