start of conversion to metaclass roles

This commit is contained in:
Graham Knop 2010-02-17 16:37:46 -06:00
parent 117c7897bb
commit 13b753850f
5 changed files with 94 additions and 76 deletions

View file

@ -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 ( )