GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOOSEX::TYPES::LOADABLECLASS (3)

.ds Aq ’

NAME

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

CONTENTS

VERSION

version 0.013

SYNOPSIS



    package MyClass;
    use Moose;
    use MooseX::Types::LoadableClass qw/ LoadableClass /;

    has foobar_class => (
        is => ro,
        required => 1,
        isa => LoadableClass,
    );

    MyClass->new(foobar_class => FooBar); # FooBar.pm is loaded or an
                                            # exception is thrown.



DESCRIPTION



    use Moose::Util::TypeConstraints;

    my $tc = subtype as ClassName;
    coerce $tc, from Str, via { Class::Load::load_class($_); $_ };



I’ve written those three lines of code quite a lot of times, in quite a lot of places.

Now I don’t have to.

TYPES EXPORTED

CWLoadableClass

A normal class / package.

CWLoadableRole

Like LoadableClass, except the loaded package must be a Moose::Role.

AUTHOR

Tomas Doran <bobtfish@bobtfish.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

CONTRIBUTORS

o Karen Etheridge <ether@cpan.org>
o Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org>
o Florian Ragwitz <rafl@debian.org>
o XXXXXX XXXXXXX <sromanov@cpan.org>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOOSEX::TYPES::LOADABLECLASS (3) 2014-11-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.