| 1 | package WebService::GrowthBook::FeatureResult; | ||||||||||
| 2 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | no indirect; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use Object::Pad; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 5 | ▶ | use Log::Any qw($log); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 5 | ▶ | use JSON::MaybeXS; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 5 | our $VERSION = '0.003'; ## VERSION | |||||||||
| 10 | |||||||||||
| 11 | class WebService::GrowthBook::FeatureResult{ | ||||||||||
| 12 | 0 | ▶ | field $feature_id :param :reader; | ||||||||
|
Subroutine
feature_id: not called CC=1 SCAR=2.6
Pod
undocumented
| |||||||||||
| 13 | 26 | ▶ | field $value :param :reader; | ||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 14 | 0 | field $source :param :reader //= ''; | |||||||||
| 15 | 0 | ▶ | field $experiment :param //= undef; | ||||||||
|
Subroutine
source: not called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||
| 16 | 5 | field $experiment_result :param //= undef; | |||||||||
| 17 | 5 | field $rule_id :param //= undef; | |||||||||
| 18 | |||||||||||
| 19 | 5 | ▶ | method on{ | ||||||||
|
Subroutine
on: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | 76 | ▶ | return $value ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 5 | } | |||||||||
| 22 | 38 | ▶ | method off{ | ||||||||
|
Subroutine
off: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 23 | 38 | my $result = $self->on; | |||||||||
| 24 | 38 | ▶ | return $result ? 0 : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 5 | } | |||||||||
| 26 | |||||||||||
| 27 | 32 | ▶ | method to_hash { | ||||||||
|
Subroutine
to_hash: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 28 | 32 | my %data = ( | |||||||||
| 29 | value => $value, | ||||||||||
| 30 | source => $source, | ||||||||||
| 31 | on => $self->on, | ||||||||||
| 32 | off => $self->off, | ||||||||||
| 33 | ); | ||||||||||
| 34 | |||||||||||
| 35 | 32 | ▶ | $data{ruleId} = $rule_id if defined $rule_id; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 32 | ▶ | $data{experiment} = $experiment->to_hash() if defined $experiment; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 32 | ▶ | $data{experimentResult} = $experiment_result->to_hash() if defined $experiment_result; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 32 | return \%data; | |||||||||
| 39 | 5 | } | |||||||||
| 40 | 5 | } | |||||||||