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