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