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