| 1 | #!/usr/bin/false | ||||||||||||
| 2 | # ABSTRACT: Bugzilla Reminder object and service | ||||||||||||
| 3 | # PODNAME: WebService::Bugzilla::Reminder | ||||||||||||
| 4 | |||||||||||||
| 5 | package WebService::Bugzilla::Reminder 0.001; | ||||||||||||
| 6 | 1 | ▶ | use strictures 2; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use namespace::clean; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 1 | extends 'WebService::Bugzilla::Object'; | |||||||||||
| 11 | |||||||||||||
| 12 | 0 | ▶ | sub _unwrap_key { 'reminders' } | ||||||||||
|
Subroutine
_unwrap_key: not called CC=1 SCAR=6.9
| |||||||||||||
| 13 | |||||||||||||
| 14 | 1 | has bug_id => (is => 'ro', lazy => 1, builder => '_build_bug_id'); | |||||||||||
| 15 | 1 | has creation_ts => (is => 'ro', lazy => 1, builder => '_build_creation_ts'); | |||||||||||
| 16 | 1 | has note => (is => 'ro', lazy => 1, builder => '_build_note'); | |||||||||||
| 17 | 1 | has reminder_ts => (is => 'ro', lazy => 1, builder => '_build_reminder_ts'); | |||||||||||
| 18 | 1 | has sent => (is => 'ro', lazy => 1, builder => '_build_sent'); | |||||||||||
| 19 | |||||||||||||
| 20 | 1 | my @attrs = qw( | |||||||||||
| 21 | bug_id | ||||||||||||
| 22 | creation_ts | ||||||||||||
| 23 | note | ||||||||||||
| 24 | reminder_ts | ||||||||||||
| 25 | sent | ||||||||||||
| 26 | ); | ||||||||||||
| 27 | |||||||||||||
| 28 | 1 | for my $attr (@attrs) { | |||||||||||
| 29 | 5 | my $build = "_build_$attr"; | |||||||||||
| 30 | { | ||||||||||||
| 31 | 1 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 32 | 5 | ▶ | *{ $build } = sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=3.5
| |||||||||||||
| 33 | 0 | my ($self) = @_; | |||||||||||
| 34 | 0 | $self->_fetch_full($self->_mkuri('reminder/' . $self->id)); | |||||||||||
| 35 | 0 | return $self->_api_data->{$attr}; | |||||||||||
| 36 | 5 | }; | |||||||||||
| 37 | } | ||||||||||||
| 38 | } | ||||||||||||
| 39 | |||||||||||||
| 40 | 0 | ▶ | sub create { | ||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 41 | 0 | my ($self, %params) = @_; | |||||||||||
| 42 | 0 | my $res = $self->client->post($self->_mkuri('reminder'), \%params); | |||||||||||
| 43 | 0 | return $self->new( | |||||||||||
| 44 | client => $self->client, | ||||||||||||
| 45 | _data => $res, | ||||||||||||
| 46 | ); | ||||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | 0 | ▶ | sub get { | ||||||||||
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 50 | 0 | my ($self, $id) = @_; | |||||||||||
| 51 | 0 | my $res = $self->client->get($self->_mkuri("reminder/$id")); | |||||||||||
| 52 | 0 | return $self->new( | |||||||||||
| 53 | client => $self->client, | ||||||||||||
| 54 | _data => $res, | ||||||||||||
| 55 | ); | ||||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | 0 | ▶ | sub remove { | ||||||||||
|
Subroutine
remove: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 59 | 0 | my ($self) = @_; | |||||||||||
| 60 | 0 | return $self->client->delete($self->_mkuri('reminder/' . $self->id)); | |||||||||||
| 61 | } | ||||||||||||
| 62 | |||||||||||||
| 63 | 0 | ▶ | sub search { | ||||||||||
|
Subroutine
search: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 64 | 0 | my ($self) = @_; | |||||||||||
| 65 | 0 | my $res = $self->client->get($self->_mkuri('reminder')); | |||||||||||
| 66 | return [ | ||||||||||||
| 67 | map { | ||||||||||||
| 68 | 0 | $self->new( | |||||||||||
| 69 | client => $self->client, | ||||||||||||
| 70 | _data => $_ | ||||||||||||
| 71 | ) | ||||||||||||
| 72 | } | ||||||||||||
| 73 | 0 | ▶ | @{ $res->{reminders} // [] } | ||||||||||
|
Condition0%0/2
$res->{"reminders"} // []
MC/DC0%0/1
$res->{"reminders"} // []
$res->{"reminders"}
Truth table0%0/2
A
A= $res->{"reminders"}
| |||||||||||||
| 74 | ]; | ||||||||||||
| 75 | } | ||||||||||||
| 76 | |||||||||||||
| 77 | 1 | 1; | |||||||||||
| 78 | |||||||||||||
| 79 | __END__ | ||||||||||||