| 1 | package Ubic::Result; | ||||||||||||||||||||||||||||
| 2 | 174 | $Ubic::Result::VERSION = '1.59'; | |||||||||||||||||||||||||||
| 3 | 174 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 174 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | # ABSTRACT: common return value for many ubic interfaces | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 174 | ▶ | use Ubic::Result::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 174 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 174 | ▶ | use parent qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 174 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||
| 14 | result | ||||||||||||||||||||||||||||
| 15 | ); | ||||||||||||||||||||||||||||
| 16 | 174 | our %EXPORT_TAGS = ( | |||||||||||||||||||||||||||
| 17 | all => \@EXPORT_OK, | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | sub result { | ||||||||||||||||||||||||||||
| 21 | 708 | ▶ | my ($str, $msg) = @_; | ||||||||||||||||||||||||||
|
Subroutine
result: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 708 | ▶ | if (blessed $str and $str->isa('Ubic::Result::Class')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($str) and $str->isa("Ubic::Result::Class")
MC/DC50%1/2
builtin::blessed($str) and $str->isa("Ubic::Result::Class")
builtin::blessed($str)
$str->isa("Ubic::Result::Class")
Truth table66%2/3
A and B
A= builtin::blessed($str)B= $str->isa("Ubic::Result::Class")
| |||||||||||||||||||||||||||||
| 23 | 351 | return $str; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | 357 | return Ubic::Result::Class->new({ type => "$str", msg => $msg }); | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 174 | 1; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | __END__ | ||||||||||||||||||||||||||||