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
MooseX::RelatedClassRoles(3) User Contributed Perl Documentation MooseX::RelatedClassRoles(3)

MooseX::RelatedClassRoles - Apply roles to a class related to yours

version 0.004

    package My::Class;
    use Moose;

    has driver_class => (
      isa => 'MyApp::Driver',
    );

    with 'MooseX::RelatedClassRoles' => { name => 'driver' };

    # ...

    my $obj = My::Class->new(driver_class => "Some::Driver");
    $obj->apply_driver_class_roles("Other::Driver::Role");

Frequently, you have to use a class that provides some "foo_class" accessor or attribute as a method of dependency injection. Use this role when you'd rather apply roles to make your custom "foo_class" instead of manually setting up a subclass.

A string naming the related class. "driver" in the "SYNOPSIS". Required.

A string naming the related class accessor. "driver_class" in the "SYNOPSIS". Defaults to appending "_class" to the "name".

A string naming the role applying method. "apply_driver_class_names" in the "SYNOPSIS". Defaults to adding "apply_" and "_names" to the "class_accessor_name".

    Florian Ragwitz (rafl)

  Hans Dieter Pearcey <hdp@cpan.org>

This software is copyright (c) 2009 by Hans Dieter Pearcey <hdp@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as perl itself.

2009-04-13 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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