1MooseX::Types::LoadableUCslearssC(o3nptmr)ibuted Perl DoMcouomseenXt:a:tTiyopnes::LoadableClass(3pm)
2
3
4

NAME

6       MooseX::Types::LoadableClass - ClassName type constraint with coercion
7       to load the class.
8

VERSION

10       version 0.015
11

SYNOPSIS

13           package MyClass;
14           use Moose;
15           use MooseX::Types::LoadableClass qw/ LoadableClass /;
16
17           has foobar_class => (
18               is => 'ro',
19               required => 1,
20               isa => LoadableClass,
21           );
22
23           MyClass->new(foobar_class => 'FooBar'); # FooBar.pm is loaded or an
24                                                   # exception is thrown.
25

DESCRIPTION

27           use Moose::Util::TypeConstraints;
28
29           my $tc = subtype as ClassName;
30           coerce $tc, from Str, via { Class::Load::load_class($_); $_ };
31
32       I've written those three lines of code quite a lot of times, in quite a
33       lot of places.
34
35       Now I don't have to.
36

TYPES EXPORTED

38   "LoadableClass"
39       A normal class / package.
40
41   "LoadableRole"
42       Like "LoadableClass", except the loaded package must be a Moose::Role.
43

SUPPORT

45       Bugs may be submitted through the RT bug tracker
46       <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-
47       LoadableClass> (or bug-MooseX-Types-LoadableClass@rt.cpan.org
48       <mailto:bug-MooseX-Types-LoadableClass@rt.cpan.org>).
49
50       There is also a mailing list available for users of this distribution,
51       at <http://lists.perl.org/list/moose.html>.
52
53       There is also an irc channel available for users of this distribution,
54       at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>.
55

AUTHOR

57       Tomas Doran <bobtfish@bobtfish.net>
58

CONTRIBUTORS

60       ·   Karen Etheridge <ether@cpan.org>
61
62       ·   Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org>
63
64       ·   Florian Ragwitz <rafl@debian.org>
65
66       ·   Gregory Oschwald <goschwald@maxmind.com>
67
68       ·   XXXXXX XXXXXXX <sromanov@cpan.org>
69
71       This software is copyright (c) 2010 by Infinity Interactive, Inc.
72
73       This is free software; you can redistribute it and/or modify it under
74       the same terms as the Perl 5 programming language system itself.
75
76
77
78perl v5.28.0                      2017-06-16 MooseX::Types::LoadableClass(3pm)
Impressum