=cut
around 'check' => sub {
- my ($check, $self, $check_value, $constraining_value) = @_;
-
- unless($self->check_dependent($check_value)) {
- return;
- }
-
- unless($self->check_constraining($constraining_value)) {
- return;
- }
-
- return $self->$check($check_value, $constraining_value);
+ my ($check, $self, @args) = @_;
+ return $self->$check(@args);
};
=head2 generate_constraint_for ($type_constraints)
sub generate_constraint_for {
my ($self, $callback, $constraining) = @_;
return sub {
- my ($check_value, $constraining_value) = @_;
+ my ($dependent_pair) = @_;
+ my ($check_value, $constraining_value) = @$dependent_pair;
+
+ ## First need to test the bits
+ unless($self->check_dependent($check_value)) {
+ return;
+ }
+
+ unless($self->check_constraining($constraining_value)) {
+ return;
+ }
+
my $constraint_generator = $self->constraint_generator;
return $constraint_generator->(
$callback,