File Coverage

blib/lib/Pithub/GitData/Blobs.pm
Criterion Covered Total %
statement 14 14 100.0
branch 4 4 100.0
condition n/a
subroutine 4 4 100.0
pod 2 2 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Pithub::GitData::Blobs;
2             our $AUTHORITY = 'cpan:PLU';
3             our $VERSION = '0.01040';
4             # ABSTRACT: Github v3 Git Data Blobs API
5              
6 16     16   153453 use Moo;
  16         31  
  16         81  
7 16     16   4168 use Carp qw( croak );
  16         42  
  16         3701  
8             extends 'Pithub::Base';
9              
10              
11             sub create {
12 5     5 1 7844 my ( $self, %args ) = @_;
13 5 100       36 croak 'Missing key in parameters: data (hashref)' unless ref $args{data} eq 'HASH';
14 3         19 $self->_validate_user_repo_args( \%args );
15             return $self->request(
16             method => 'POST',
17 3         58 path => sprintf( '/repos/%s/%s/git/blobs', delete $args{user}, delete $args{repo} ),
18             %args,
19             );
20             }
21              
22              
23             sub get {
24 3     3 1 1899 my ( $self, %args ) = @_;
25 3 100       19 croak 'Missing key in parameters: sha' unless $args{sha};
26 2         11 $self->_validate_user_repo_args( \%args );
27             return $self->request(
28             method => 'GET',
29 2         21 path => sprintf( '/repos/%s/%s/git/blobs/%s', delete $args{user}, delete $args{repo}, delete $args{sha} ),
30             %args,
31             );
32             }
33              
34             1;
35              
36             __END__