1 package DX::ResolutionStrategy;
6 has action_prototypes => (is => 'ro', required => 1);
8 has veracity_depends_on_builder => (is => 'ro', required => 1);
10 has implementation_candidates => (is => 'ro', required => 1);
12 has aperture => (is => 'lazy', builder => sub {
15 # [ $thing, 'set_value' ] -> $thing->aperture_for_set_value
16 map @{$_->[0]->${\'aperture_for_'.$_[1]}()},
17 @{$self->action_prototypes}
23 return undef unless my ($first) = @{$self->implementation_candidates};
24 my @ap = @{$self->action_prototypes};
26 return DX::Resolution->new(
29 my ($inv, $type, @args) = @{$ap[$_]};
30 $inv->${\"action_for_${type}"}(@args, @{$cand[$_]});
33 veracity_depends_on => $self->veracity_depends_on_builder->(@cand),
39 my ($first, @rest) = @{$self->implementation_candidates};
40 return () unless @rest;
41 return $self->but(implementation_candidates => \@rest);