bump version # and update changes
[gitmo/Class-MOP.git] / lib / Class / MOP / Module.pm
CommitLineData
2243a22b 1
2package Class::MOP::Module;
3
4use strict;
5use warnings;
6
7use Scalar::Util 'blessed';
8
7329b9e2 9our $VERSION = '0.70';
d519662a 10$VERSION = eval $VERSION;
f0480c45 11our $AUTHORITY = 'cpan:STEVAN';
2243a22b 12
13use base 'Class::MOP::Package';
14
7f436b8c 15sub version {
16 my $self = shift;
8b49a472 17 ${$self->get_package_symbol({ sigil => '$', type => 'SCALAR', name => 'VERSION' })};
7f436b8c 18}
19
f0480c45 20sub authority {
21 my $self = shift;
8b49a472 22 ${$self->get_package_symbol({ sigil => '$', type => 'SCALAR', name => 'AUTHORITY' })};
f0480c45 23}
9d6dce77 24
f0480c45 25sub identifier {
26 my $self = shift;
27 join '-' => (
28 $self->name,
29 ($self->version || ()),
30 ($self->authority || ()),
31 );
32}
9d6dce77 33
2243a22b 341;
35
36__END__
37
38=pod
39
40=head1 NAME
41
42Class::MOP::Module - Module Meta Object
43
2243a22b 44=head1 DESCRIPTION
45
127d39a7 46This is an abstraction of a Perl 5 module, it is a superclass of
47L<Class::MOP::Class>. A module essentially a package with metadata,
48in our case the version and authority.
49
2243a22b 50=head1 METHODS
51
52=over 4
53
54=item B<meta>
55
127d39a7 56Returns a metaclass for this package.
57
58=item B<initialize ($package_name)>
59
60This will initialize a Class::MOP::Module instance which represents
61the module of C<$package_name>.
62
7f436b8c 63=item B<version>
64
b9d9fc0b 65This is a read-only attribute which returns the C<$VERSION> of the
66package for the given instance.
67
f0480c45 68=item B<authority>
69
b9d9fc0b 70This is a read-only attribute which returns the C<$AUTHORITY> of the
71package for the given instance.
72
f0480c45 73=item B<identifier>
74
96e38ba6 75This constructs a string of the name, version and authority.
b9d9fc0b 76
2243a22b 77=back
78
1a09d9cc 79=head1 AUTHORS
2243a22b 80
81Stevan Little E<lt>stevan@iinteractive.comE<gt>
82
83=head1 COPYRIGHT AND LICENSE
84
69e3ab0a 85Copyright 2006-2008 by Infinity Interactive, Inc.
2243a22b 86
87L<http://www.iinteractive.com>
88
89This library is free software; you can redistribute it and/or modify
90it under the same terms as Perl itself.
91
ebce5539 92=cut