blob: 4066d3c6a3643d76ed9a08bf707eb97d4e05e67e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package Reaction::InterfaceModel::Action::Role::SimpleMethodCall;
use Reaction::Role;
use Scalar::Util 'blessed';
requires '_target_model_method';
sub can_apply { 1; }
sub do_apply {
my ($self) = @_;
my $object = $self->target_model;
my $method_name = $self->_target_model_method;
if(my $method_ref = $object->can($method_name)){
return $object->$method_ref();
}
confess("Object ".blessed($object)." doesn't support method ${method_name}");
}
1;
|