File Coverage

blib/lib/WWW/VastAI/SSHKey.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition 1 3 33.3
subroutine 5 5 100.0
pod 4 4 100.0
total 20 22 90.9


line stmt bran cond sub pod time code
1             package WWW::VastAI::SSHKey;
2             our $VERSION = '0.001';
3             # ABSTRACT: Account SSH key wrapper with update and delete helpers
4              
5 11     11   446 use Moo;
  11         23  
  11         65  
6             extends 'WWW::VastAI::Object';
7              
8             sub key {
9 2     2 1 1572 my ($self) = @_;
10 2   33     33 return $self->data->{key} // $self->data->{public_key};
11             }
12 1     1 1 7 sub created_at { shift->data->{created_at} }
13              
14             sub update {
15 1     1 1 4 my ($self, $ssh_key) = @_;
16 1         40 return $self->_replace_data($self->_client->ssh_keys->update($self->id, $ssh_key)->raw);
17             }
18              
19             sub delete {
20 1     1 1 3 my ($self) = @_;
21 1         39 return $self->_client->ssh_keys->delete($self->id);
22             }
23              
24             1;
25              
26             __END__