| 1 | package Qless::Config; | ||||||||||
| 2 | =head1 NAME | ||||||||||
| 3 | |||||||||||
| 4 | Qless::Config | ||||||||||
| 5 | |||||||||||
| 6 | =cut | ||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use JSON::XS qw(decode_json); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 12 | 0 | my $class = shift; | |||||||||
| 13 | 0 | my ($client) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | $class = ref $class if ref $class; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | my $self = bless {}, $class; | |||||||||
| 17 | |||||||||||
| 18 | 0 | $self->{'client'} = $client; | |||||||||
| 19 | |||||||||||
| 20 | 0 | $self; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub get { | ||||||||
|
Subroutine
get: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 0 | my ($self, $key) = @_; | |||||||||
| 25 | 0 | ▶ | if ($key) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | return $self->{'client'}->_config([], 'get', $key); | |||||||||
| 27 | } | ||||||||||
| 28 | 0 | return decode_json($self->{'client'}->_config([], 'get')); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub set { | ||||||||
|
Subroutine
set: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | my ($self, $key, $value) = @_; | |||||||||
| 33 | 0 | return $self->{'client'}->_config([], 'set', $key, $value); | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub del { | ||||||||
|
Subroutine
del: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 37 | 0 | my ($self, $key, $value) = @_; | |||||||||
| 38 | 0 | return $self->{'client'}->_config([], 'unset', $key); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 1 | 1; | |||||||||