Re: Apply parameterized roles to classes (not instances) at runtime
[email protected] (Gianni Ceccarelli) Mon, 17 Feb 2014 20:04:31 +0000
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <20140217200431.7c1259b8@nautilus> |
Maybe:
My::Role->meta->apply(Some::Other::Class->meta, bridge => ... );
or even better:
use Moose::Util 'apply_all_roles';
apply_all_roles('Some::Other::Class','My::Role' => {
bridge => My::Class->new({
foo => 'this is foo',
bar => 'this is bar',
}),
});
(tested)
--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88
Fly Windows NT:
All the passengers carry their seats out onto the tarmac, placing the
chairs in the outline of a plane. They all sit down, flap their arms
and make jet swooshing sounds as if they are flying.
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlMCa1QACgkQQOqYg3UZP4j2BgCfaLWAAwXYNrMzUhYmWR60+FrN EaUAnjfGDjHb2pfSHHLSp+owTcoZD5dB =lRyH -----END PGP SIGNATURE-----