1 package Moose::Meta::Role::Application::ToInstance;
8 use Scalar::Util 'blessed';
12 our $VERSION = '0.01';
13 our $AUTHORITY = 'cpan:STEVAN';
15 use base 'Moose::Meta::Role::Application::ToClass';
20 my ($self, $role, $object) = @_;
23 # We really should do this better, and
24 # cache the results of our efforts so
25 # that we don't need to repeat them.
27 my $pkg_name = __PACKAGE__ . "::__RUNTIME_ROLE_ANON_CLASS__::" . $anon_counter++;
28 eval "package " . $pkg_name . "; our \$VERSION = '0.00';";
31 my $class = Moose::Meta::Class->initialize($pkg_name);
32 $class->superclasses(blessed($object));
34 bless $object => $class->name;
36 $self->SUPER::apply($role, $class);
47 Moose::Meta::Role::Application::ToInstance
65 All complex software has bugs lurking in it, and this module is no
66 exception. If you find a bug please either email me, or add the bug
71 Stevan Little E<lt>stevan@iinteractive.comE<gt>
73 =head1 COPYRIGHT AND LICENSE
75 Copyright 2006-2008 by Infinity Interactive, Inc.
77 L<http://www.iinteractive.com>
79 This library is free software; you can redistribute it and/or modify
80 it under the same terms as Perl itself.