adding more test and such
[gitmo/MooseX-MetaDescription.git] / lib / MooseX / MetaDescription / Meta / Trait.pm
1 package MooseX::MetaDescription::Meta::Trait;
2 use Moose::Role;
3
4 our $VERSION   = '0.01';
5 our $AUTHORITY = 'cpan:STEVAN';
6
7 has 'description' => (
8     is      => 'ro',
9     isa     => 'HashRef',
10     lazy    => 1,   
11     default => sub { +{} },
12 );
13
14 has 'metadescription_classname' => (
15     is      => 'ro',
16     isa     => 'Str', 
17     lazy    => 1,  
18     default => sub {
19         'MooseX::MetaDescription::Description'
20     }  
21 );
22
23 has 'metadescription' => (
24     is      => 'ro',
25     isa     => 'MooseX::MetaDescription::Description',
26     lazy    => 1,   
27     default => sub {
28         my $self = shift;
29         $self->metadescription_classname->new(
30             %{ $self->description },
31             descriptor => $self,
32         );
33     },
34 );
35
36 no Moose::Role; 1;
37
38 __END__
39
40 =pod
41
42 =head1 NAME
43
44 MooseX::MetaDescription::Meta::Trait - A Moosey solution to this problem
45
46 =head1 SYNOPSIS
47
48   use MooseX::MetaDescription::Meta::Trait;
49
50 =head1 DESCRIPTION
51
52 =head1 METHODS 
53
54 =over 4
55
56 =item B<>
57
58 =back
59
60 =head1 BUGS
61
62 All complex software has bugs lurking in it, and this module is no 
63 exception. If you find a bug please either email me, or add the bug
64 to cpan-RT.
65
66 =head1 AUTHOR
67
68 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
69
70 =head1 COPYRIGHT AND LICENSE
71
72 Copyright 2008 Infinity Interactive, Inc.
73
74 L<http://www.iinteractive.com>
75
76 This library is free software; you can redistribute it and/or modify
77 it under the same terms as Perl itself.
78
79 =cut