2 package Class::MOP::Module;
8 use Scalar::Util 'blessed';
10 our $VERSION = '0.81';
11 $VERSION = eval $VERSION;
12 our $AUTHORITY = 'cpan:STEVAN';
14 use base 'Class::MOP::Package';
18 ${$self->get_package_symbol({ sigil => '$', type => 'SCALAR', name => 'VERSION' })};
23 ${$self->get_package_symbol({ sigil => '$', type => 'SCALAR', name => 'AUTHORITY' })};
30 ($self->version || ()),
31 ($self->authority || ()),
36 confess "The Class::MOP::Module->create method has been made a private object method.\n";
39 sub _instantiate_module {
42 my $authority = shift;
44 my $package_name = $self->name;
46 my $code = "package $package_name;";
48 $code .= "\$$package_name\:\:VERSION = '" . $version . "';"
50 $code .= "\$$package_name\:\:AUTHORITY = '" . $authority . "';"
51 if defined $authority;
54 confess "creation of $package_name failed : $@" if $@;
65 Class::MOP::Module - Module Meta Object
69 A module is essentially a L<Class::MOP::Package> with metadata, in our
70 case the version and authority.
74 B<Class::MOP::Module> is a subclass of L<Class::MOP::Package>.
80 =item B<< $metamodule->version >>
82 This is a read-only attribute which returns the C<$VERSION> of the
83 package, if one exists.
85 =item B<< $metamodule->authority >>
87 This is a read-only attribute which returns the C<$AUTHORITY> of the
88 package, if one exists.
90 =item B<< $metamodule->identifier >>
92 This constructs a string which combines the name, version and
95 =item B<< Class::MOP::Module->meta >>
97 This will return a L<Class::MOP::Class> instance for this class.
103 Stevan Little E<lt>stevan@iinteractive.comE<gt>
105 =head1 COPYRIGHT AND LICENSE
107 Copyright 2006-2009 by Infinity Interactive, Inc.
109 L<http://www.iinteractive.com>
111 This library is free software; you can redistribute it and/or modify
112 it under the same terms as Perl itself.