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