small adjustments

This commit is contained in:
Graham Knop 2009-12-04 10:41:13 -06:00
parent b6058e8b11
commit fdb72a6d7f
3 changed files with 4 additions and 3 deletions

View file

@ -79,7 +79,7 @@ Sets the metaclass to WebGUI::Definition::Meta::Class.
sub init_meta { sub init_meta {
my $class = shift; my $class = shift;
my %options = @_; my %options = @_;
$options{metaclass} = 'WebGUI::Definition::Meta::Class'; $options{metaclass} = 'WebGUI::Definition::Meta::Class';
return Moose->init_meta(%options); return Moose->init_meta(%options);
} }

View file

@ -22,7 +22,6 @@ use WebGUI::Definition::Meta::Asset;
use namespace::autoclean; use namespace::autoclean;
no warnings qw(uninitialized); no warnings qw(uninitialized);
our $VERSION = '0.0.1'; our $VERSION = '0.0.1';
=head1 NAME =head1 NAME
@ -84,7 +83,7 @@ meta class into the options for each property.
sub property { sub property {
my ($meta, $name, %options) = @_; my ($meta, $name, %options) = @_;
$options{table} = $meta->table; $options{table} //= $meta->table;
return WebGUI::Definition::property($meta, $name, %options); return WebGUI::Definition::property($meta, $name, %options);
} }

View file

@ -38,6 +38,8 @@ sub set {
my $self = shift; my $self = shift;
my $properties = shift; my $properties = shift;
for my $key ( keys %$properties ) { for my $key ( keys %$properties ) {
return undef
unless $self->can($key);
$self->$key($properties->{$key}); $self->$key($properties->{$key});
} }
return 1; return 1;