2 package Class::MOP::Module;
8 use Scalar::Util 'blessed';
10 our $VERSION = '0.78';
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 my ( $class, %options ) = @_;
38 my $package_name = $options{package};
40 (defined $package_name && $package_name)
41 || confess "You must pass a package name";
43 my $code = "package $package_name;";
44 $code .= "\$$package_name\:\:VERSION = '" . $options{version} . "';"
45 if exists $options{version};
46 $code .= "\$$package_name\:\:AUTHORITY = '" . $options{authority} . "';"
47 if exists $options{authority};
50 confess "creation of $package_name failed : $@" if $@;
52 return; # XXX: should this return some kind of meta object? ~sartak
63 Class::MOP::Module - Module Meta Object
67 This is an abstraction of a Perl 5 module, it is a superclass of
68 L<Class::MOP::Class>. A module essentially a package with metadata,
69 in our case the version and authority.
73 B<Class::MOP::Module> is a subclass of L<Class::MOP::Package>
81 Returns a metaclass for this package.
83 =item B<initialize ($package_name)>
85 This will initialize a Class::MOP::Module instance which represents
86 the module of C<$package_name>.
90 This is a read-only attribute which returns the C<$VERSION> of the
91 package for the given instance.
95 This is a read-only attribute which returns the C<$AUTHORITY> of the
96 package for the given instance.
100 This constructs a string of the name, version and authority.
104 This creates the module; it does not return a useful result.
110 Stevan Little E<lt>stevan@iinteractive.comE<gt>
112 =head1 COPYRIGHT AND LICENSE
114 Copyright 2006-2009 by Infinity Interactive, Inc.
116 L<http://www.iinteractive.com>
118 This library is free software; you can redistribute it and/or modify
119 it under the same terms as Perl itself.