our $VERSION = '0.01';
our $AUTHORITY = 'cpan:STEVAN';
-use base 'Moose::Meta::Role::Application';
+use base 'Moose::Meta::Role::Application::ToClass';
+
+my $anon_counter = 0;
+
+sub apply {
+ my ($self, $role, $object) = @_;
+
+ # FIXME:
+ # We really should do this better, and
+ # cache the results of our efforts so
+ # that we don't need to repeat them.
+
+ my $pkg_name = __PACKAGE__ . "::__RUNTIME_ROLE_ANON_CLASS__::" . $anon_counter++;
+ eval "package " . $pkg_name . "; our \$VERSION = '0.00';";
+ die $@ if $@;
+
+ my $class = Moose::Meta::Class->initialize($pkg_name);
+ $class->superclasses(blessed($object));
+
+ bless $object => $class->name;
+
+ $self->SUPER::apply($role, $class);
+}
1;
=item B<meta>
+=item B<apply>
+
=back
=head1 BUGS