File Coverage

blib/lib/SyForm/ViewRole/Success.pm
Criterion Covered Total %
statement 10 10 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 16 17 94.1


line stmt bran cond sub pod time code
1             package SyForm::ViewRole::Success;
2             BEGIN {
3 6     6   3869 $SyForm::ViewRole::Success::AUTHORITY = 'cpan:GETTY';
4             }
5             # ABSTRACT: Fetching success value from SyForn::Results of give back true
6             $SyForm::ViewRole::Success::VERSION = '0.103';
7 6     6   43 use Moo::Role;
  6         15  
  6         35  
8              
9 6     6   2660 use overload 'bool' => sub { $_[0]->success };
  6     4   33  
  6         55  
  4         160  
10              
11             has success => (
12             is => 'lazy',
13             );
14              
15             sub _build_success {
16 6     6   1016 my ( $self ) = @_;
17 6 50       57 return $self->results->does('SyForm::ResultsRole::Success')
18             ? $self->results->success : 1;
19             }
20              
21             1;
22              
23             __END__
24              
25             =pod
26              
27             =head1 NAME
28              
29             SyForm::ViewRole::Success - Fetching success value from SyForn::Results of give back true
30              
31             =head1 VERSION
32              
33             version 0.103
34              
35             =head1 AUTHOR
36              
37             Torsten Raudssus <torsten@raudss.us>
38              
39             =head1 COPYRIGHT AND LICENSE
40              
41             This software is copyright (c) 2014 by Torsten Raudssus.
42              
43             This is free software; you can redistribute it and/or modify it under
44             the same terms as the Perl 5 programming language system itself.
45              
46             =cut