Commit | Line | Data |
b70e06c6 |
1 | package MooseX::MetaDescription::Meta::Trait; |
c13295c8 |
2 | use Moose::Role; |
3 | |
c13295c8 |
4 | our $VERSION = '0.01'; |
5 | our $AUTHORITY = 'cpan:STEVAN'; |
6 | |
7591e02c |
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', |
91297cb4 |
17 | lazy => 1, |
7591e02c |
18 | default => sub { |
19 | 'MooseX::MetaDescription::Description' |
20 | } |
21 | ); |
c13295c8 |
22 | |
7591e02c |
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, |
91297cb4 |
32 | ); |
c13295c8 |
33 | }, |
34 | ); |
35 | |
36 | no Moose::Role; 1; |
37 | |
38 | __END__ |
39 | |
40 | =pod |
41 | |
42 | =head1 NAME |
43 | |
b70e06c6 |
44 | MooseX::MetaDescription::Meta::Trait - A Moosey solution to this problem |
c13295c8 |
45 | |
46 | =head1 SYNOPSIS |
47 | |
b70e06c6 |
48 | use MooseX::MetaDescription::Meta::Trait; |
c13295c8 |
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 |