my %args = @_;
my $instance = bless {}, $class;
- for my $attribute ($class->meta->attributes) {
+ for my $attribute (values %{ $class->meta->get_attribute_map }) {
my $key = $attribute->init_arg;
my $default;
}
else {
if ($attribute->is_required) {
- confess "Attribute '".$attribute->name."' is required";
+ confess "Attribute (".$attribute->name.") is required";
}
}
}