| 1 | package Reaction::UI::ViewPort::Action::Role::Apply; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use Reaction::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use MooseX::Types::Moose qw/Str CodeRef/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | requires 'do_apply'; | |||||||||||||||||||||||||||
| 7 | 4 | has apply_label => (is => 'rw', isa => Str, lazy_build => 1); | |||||||||||||||||||||||||||
| 8 | 4 | has on_apply_callback => (is => 'rw', isa => CodeRef); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 3 | ▶ | sub _build_apply_label { 'apply' } | ||||||||||||||||||||||||||
|
Subroutine
_build_apply_label: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub can_apply { 1 } | ||||||||||||||||||||||||||
|
Subroutine
can_apply: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | ▶ | sub apply { | ||||||||||||||||||||||||||
|
Subroutine
apply: called CC=5 SCAR=22.5
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 16 | 2 | ▶ | if ($self->can_apply && (my $result = $self->do_apply)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->can_apply and my $result = $self->do_apply
MC/DC0%0/2
$self->can_apply and my $result = $self->do_apply
$self->can_apply
my $result = $self->do_apply
Truth table33%1/3
A and B
A= $self->can_applyB= my $result = $self->do_apply
| |||||||||||||||||||||||||||||
| 17 | 2 | ▶ | $self->on_apply_callback->($self => $result) if $self->has_on_apply_callback; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 2 | return 1; | |||||||||||||||||||||||||||
| 19 | } else { | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | if( my $coderef = $self->can('close_label') ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | $self->$coderef( $self->close_label_cancel ); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 0 | return 0; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | }; | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 11 | ▶ | around accept_events => sub { ( 'apply', shift->(@_) ) }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 4 | 1; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | __END__ | ||||||||||||||||||||||||||||