| 1 | package Pithub::SearchV3; | ||||||||||||||||||
| 2 | 15 | our $AUTHORITY = 'cpan:PLU'; | |||||||||||||||||
| 3 | 15 | our $VERSION = '0.01043'; | |||||||||||||||||
| 4 | |||||||||||||||||||
| 5 | # ABSTRACT: Github v3 Search API | ||||||||||||||||||
| 6 | |||||||||||||||||||
| 7 | 15 | ▶ | use Moo; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 8 | 15 | ▶ | use Carp qw( croak ); | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 9 | 15 | extends 'Pithub::Base'; | |||||||||||||||||
| 10 | |||||||||||||||||||
| 11 | |||||||||||||||||||
| 12 | 1 | ▶ | sub issues { | ||||||||||||||||
|
Subroutine
issues: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||
| 13 | 1 | my $self = shift; | |||||||||||||||||
| 14 | 1 | return $self->_search( 'issues', @_ ); | |||||||||||||||||
| 15 | } | ||||||||||||||||||
| 16 | |||||||||||||||||||
| 17 | |||||||||||||||||||
| 18 | 1 | ▶ | sub repos { | ||||||||||||||||
|
Subroutine
repos: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||
| 19 | 1 | my $self = shift; | |||||||||||||||||
| 20 | 1 | return $self->_search( 'repositories', @_ ); | |||||||||||||||||
| 21 | } | ||||||||||||||||||
| 22 | |||||||||||||||||||
| 23 | |||||||||||||||||||
| 24 | 1 | ▶ | sub users { | ||||||||||||||||
|
Subroutine
users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||
| 25 | 1 | my $self = shift; | |||||||||||||||||
| 26 | 1 | return $self->_search( 'users', @_ ); | |||||||||||||||||
| 27 | } | ||||||||||||||||||
| 28 | |||||||||||||||||||
| 29 | |||||||||||||||||||
| 30 | 0 | ▶ | sub code { | ||||||||||||||||
|
Subroutine
code: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||
| 31 | 0 | my $self = shift; | |||||||||||||||||
| 32 | 0 | return $self->_search( 'code', @_ ); | |||||||||||||||||
| 33 | } | ||||||||||||||||||
| 34 | |||||||||||||||||||
| 35 | 3 | ▶ | sub _search { | ||||||||||||||||
|
Subroutine
_search: called CC=5 SCAR=18.2
| |||||||||||||||||||
| 36 | 3 | my ( $self, $thing_to_search, %args ) = @_; | |||||||||||||||||
| 37 | 3 | ▶ | croak 'Missing key in parameters: q' unless exists $args{q}; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 38 | return $self->request( | ||||||||||||||||||
| 39 | method => 'GET', | ||||||||||||||||||
| 40 | path => '/search/' . $thing_to_search, | ||||||||||||||||||
| 41 | query => { | ||||||||||||||||||
| 42 | q => delete $args{q}, | ||||||||||||||||||
| 43 | ( exists $args{sort} ? ( sort => delete $args{sort} ) : () ), | ||||||||||||||||||
| 44 | ( exists $args{order} ? ( order => delete $args{order} ) : () ), | ||||||||||||||||||
| 45 | 3 | ▶ | ( exists $args{per_page} ? ( per_page => delete $args{per_page} ) : () ), | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 46 | }, | ||||||||||||||||||
| 47 | %args, | ||||||||||||||||||
| 48 | ); | ||||||||||||||||||
| 49 | } | ||||||||||||||||||
| 50 | |||||||||||||||||||
| 51 | 15 | 1; | |||||||||||||||||
| 52 | |||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||