summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-03-24 13:57:27 -0500
committerJesse Luehrs <doy@tozt.net>2011-03-24 13:57:27 -0500
commit1279ccc9e428866638d87ab91d4c5844241d5b48 (patch)
tree044283ba5f6e0bd64e7d17e395fb011ede9ab038 /lib
parent990c3c03a657a5e42d667d854d75c260c889df00 (diff)
downloadbread-board-declare-1279ccc9e428866638d87ab91d4c5844241d5b48.tar.gz
bread-board-declare-1279ccc9e428866638d87ab91d4c5844241d5b48.zip
also need to check attribute type constraints during dep resolution
Diffstat (limited to 'lib')
-rw-r--r--lib/Bread/Board/Declare/Role/Service.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Bread/Board/Declare/Role/Service.pm b/lib/Bread/Board/Declare/Role/Service.pm
index e0b36f9..96bdaf7 100644
--- a/lib/Bread/Board/Declare/Role/Service.pm
+++ b/lib/Bread/Board/Declare/Role/Service.pm
@@ -29,12 +29,17 @@ around get => sub {
my $self = shift;
my $container = $self->parent_container;
+ my $attr = $self->associated_attribute;
- if ($self->associated_attribute->has_value($container)) {
- return $self->associated_attribute->get_value($container);
+ if ($attr->has_value($container)) {
+ return $attr->get_value($container);
}
- return $self->$orig(@_);
+ my $val = $self->$orig(@_);
+ $attr->verify_against_type_constraint($val, instance => $container)
+ if $attr->has_type_constraint;
+
+ return $val;
};
=method parent_container