14 handles => { 'invoke_callback' => 'execute' },
17 has callback_method => (
21 handles => { 'invoke_method_callback' => 'execute_method' },
28 handles => { 'multiply' => 'execute' },
33 my $thingy = Thingy->new(
34 callback => sub { ++$i },
35 multiplier => sub { $_[0] * 2 },
36 callback_method => sub { shift->multiply(@_) },
40 $thingy->invoke_callback;
42 is($thingy->multiply(3), 6);
43 is($thingy->invoke_method_callback(3), 6);
45 ok(!$thingy->can($_), "Code trait didn't create reader method for $_")
46 for qw(callback callback_method multiplier);