| 1 | package WWW::VastAI::SSHKey; | ||||||||||||||||||||
| 2 | 11 | our $VERSION = '0.001'; | |||||||||||||||||||
| 3 | # ABSTRACT: Account SSH key wrapper with update and delete helpers | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 11 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 11 | extends 'WWW::VastAI::Object'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 2 | ▶ | sub key { | ||||||||||||||||||
|
Subroutine
key: called CC=2 SCAR=8.1
Pod
documented
| |||||||||||||||||||||
| 9 | 2 | my ($self) = @_; | |||||||||||||||||||
| 10 | 2 | ▶ | return $self->data->{key} // $self->data->{public_key}; | ||||||||||||||||||
|
Condition33%1/3
$self->data->{"key"} // $self->data->{"public_key"}
MC/DC0%0/2
$self->data->{"key"} // $self->data->{"public_key"}
$self->data->{"key"}
$self->data->{"public_key"}
Truth table33%1/3
A // B
A= $self->data->{"key"}B= $self->data->{"public_key"}
| |||||||||||||||||||||
| 11 | } | ||||||||||||||||||||
| 12 | 1 | ▶ | sub created_at { shift->data->{created_at} } | ||||||||||||||||||
|
Subroutine
created_at: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 15 | 1 | my ($self, $ssh_key) = @_; | |||||||||||||||||||
| 16 | 1 | return $self->_replace_data($self->_client->ssh_keys->update($self->id, $ssh_key)->raw); | |||||||||||||||||||
| 17 | } | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 20 | 1 | my ($self) = @_; | |||||||||||||||||||
| 21 | 1 | return $self->_client->ssh_keys->delete($self->id); | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 11 | 1; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | __END__ | ||||||||||||||||||||