uploadin
[gitmo/Moose.git] / lib / Moose / Meta / Attribute.pm
1
2 package Moose::Meta::Attribute;
3
4 use strict;
5 use warnings;
6
7 our $VERSION = '0.01';
8
9 use base 'Class::MOP::Attribute';
10
11 Moose::Meta::Attribute->meta->add_around_method_modifier('new' => sub {
12         my $cont = shift;
13     my ($class, $attribute_name, %options) = @_;
14     
15     # extract the init_arg
16     my ($init_arg) = ($attribute_name =~ /^[\$\@\%][\.\:](.*)$/);     
17     
18     $cont->($class, $attribute_name, (init_arg => $init_arg, %options));
19 });
20
21
22 1;
23
24 __END__
25
26 =pod
27
28 =head1 NAME
29
30 Moose::Meta::Attribute - 
31
32 =head1 SYNOPSIS
33
34 =head1 DESCRIPTION
35
36 =head1 METHODS
37
38 =over 4
39
40 =item B<new>
41
42 =back
43
44 =head1 BUGS
45
46 All complex software has bugs lurking in it, and this module is no 
47 exception. If you find a bug please either email me, or add the bug
48 to cpan-RT.
49
50 =head1 CODE COVERAGE
51
52 I use L<Devel::Cover> to test the code coverage of my tests, below is the 
53 L<Devel::Cover> report on this module's test suite.
54
55 =head1 ACKNOWLEDGEMENTS
56
57 =head1 AUTHOR
58
59 Stevan Little E<lt>stevan@iinteractive.comE<gt>
60
61 =head1 COPYRIGHT AND LICENSE
62
63 Copyright 2006 by Infinity Interactive, Inc.
64
65 L<http://www.iinteractive.com>
66
67 This library is free software; you can redistribute it and/or modify
68 it under the same terms as Perl itself. 
69
70 =cut