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