package MooseX::MetaDescription::Meta::Attribute::Trait;
use Moose::Role;
-use MooseX::MetaDescription::Description::Attribute;
-
our $VERSION = '0.01';
our $AUTHORITY = 'cpan:STEVAN';
-with 'MooseX::MetaDescription::Meta::Role::HasMetaDescription';
+has 'description' => (
+ is => 'ro',
+ isa => 'HashRef',
+ lazy => 1,
+ default => sub { +{} },
+);
+
+has 'metadescription_classname' => (
+ is => 'ro',
+ isa => 'Str',
+ default => sub {
+ 'MooseX::MetaDescription::Description'
+ }
+);
-has '+metadescription_classname' => (
- default => sub {
- 'MooseX::MetaDescription::Description::Attribute'
+has 'metadescription' => (
+ is => 'ro',
+ isa => 'MooseX::MetaDescription::Description',
+ lazy => 1,
+ default => sub {
+ my $self = shift;
+ $self->metadescription_classname->new(
+ %{ $self->description },
+ descriptor => $self,
+ )
},
);