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