From: Shawn M Moore Date: Sun, 9 Nov 2008 02:44:35 +0000 (+0000) Subject: Set up the metaclass of parameterized roles X-Git-Tag: 0.05~112 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b42fc96dde1daa2b25e050e2c50cab3ce1b792f;p=gitmo%2FMooseX-Role-Parameterized.git Set up the metaclass of parameterized roles --- diff --git a/lib/MooseX/Role/Parameterized.pm b/lib/MooseX/Role/Parameterized.pm new file mode 100644 index 0000000..8c16ba8 --- /dev/null +++ b/lib/MooseX/Role/Parameterized.pm @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +package MooseX::Role::Parameterized; +use strict; +use warnings; +use MooseX::Role::Parameterized::Meta::Role; + +use Moose::Role (); +use Moose::Exporter; + +Moose::Exporter->setup_import_methods; + +sub init_meta { + my $self = shift; + + return Moose::Role->init_meta(@_, + metaclass => 'MooseX::Role::Parameterized::Meta::Role', + ); +} + +1; + diff --git a/lib/MooseX/Role/Parameterized/Meta/Role.pm b/lib/MooseX/Role/Parameterized/Meta/Role.pm new file mode 100644 index 0000000..60c6eb7 --- /dev/null +++ b/lib/MooseX/Role/Parameterized/Meta/Role.pm @@ -0,0 +1,14 @@ +#!/usr/bin/env perl +package MooseX::Role::Parameterized::Meta::Role; +use Moose; +extends 'Moose::Meta::Role'; + +use MooseX::Role::Parameterized::Parameters; + +sub parameter_class { 'MooseX::Role::Parameterized::Parameters' } + +__PACKAGE__->meta->make_immutable; +no Moose; + +1; +