start of conversion to metaclass roles
This commit is contained in:
parent
117c7897bb
commit
13b753850f
5 changed files with 94 additions and 76 deletions
|
|
@ -15,13 +15,11 @@ package WebGUI::Definition::Meta::Asset;
|
|||
=cut
|
||||
|
||||
use 5.010;
|
||||
use Moose;
|
||||
use Moose::Role;
|
||||
use namespace::autoclean;
|
||||
use WebGUI::Definition::Meta::Property::Asset;
|
||||
no warnings qw(uninitialized);
|
||||
|
||||
extends 'WebGUI::Definition::Meta::Class';
|
||||
|
||||
our $VERSION = '0.0.1';
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -51,14 +49,23 @@ for properties.
|
|||
|
||||
=cut
|
||||
|
||||
sub property_meta {
|
||||
return 'WebGUI::Definition::Meta::Property::Asset';
|
||||
}
|
||||
around property_traits => sub {
|
||||
my ($orig, $self) = shift;
|
||||
my $traits = $self->$orig;
|
||||
push @$traits, 'WebGUI::Definition::Meta::Property::Asset';
|
||||
return $traits;
|
||||
};
|
||||
|
||||
has [ qw{tableName icon assetName uiLevel} ] => (
|
||||
is => 'rw',
|
||||
);
|
||||
|
||||
around add_property => sub {
|
||||
my ($orig, $self, $name, %options) = shift;
|
||||
$options{tableName} //= $self->tableName;
|
||||
return $self->$orig($name, %options);
|
||||
};
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 tableName ( )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue