| 1 | package Pithub::SearchV3; | ||||||||||||||
| 2 | 15 | our $AUTHORITY = 'cpan:PLU'; | |||||||||||||
| 3 | 15 | our $VERSION = '0.01041'; | |||||||||||||
| 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 | sub issues { | ||||||||||||||
| 13 | 1 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
issues: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 14 | 1 | return $self->_search( 'issues', @_ ); | |||||||||||||
| 15 | } | ||||||||||||||
| 16 | |||||||||||||||
| 17 | |||||||||||||||
| 18 | sub repos { | ||||||||||||||
| 19 | 1 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
repos: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 20 | 1 | return $self->_search( 'repositories', @_ ); | |||||||||||||
| 21 | } | ||||||||||||||
| 22 | |||||||||||||||
| 23 | |||||||||||||||
| 24 | sub users { | ||||||||||||||
| 25 | 1 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 26 | 1 | return $self->_search( 'users', @_ ); | |||||||||||||
| 27 | } | ||||||||||||||
| 28 | |||||||||||||||
| 29 | |||||||||||||||
| 30 | sub code { | ||||||||||||||
| 31 | 0 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
code: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 32 | 0 | return $self->_search( 'code', @_ ); | |||||||||||||
| 33 | } | ||||||||||||||
| 34 | |||||||||||||||
| 35 | sub _search { | ||||||||||||||
| 36 | 3 | ▶ | my ( $self, $thing_to_search, %args ) = @_; | ||||||||||||
|
Subroutine
_search: called CC=4 SCAR=15.2
| |||||||||||||||
| 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 | 3 | ▶ | ( exists $args{order} ? ( order => delete $args{order} ) : () ), | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 45 | }, | ||||||||||||||
| 46 | %args, | ||||||||||||||
| 47 | ); | ||||||||||||||
| 48 | } | ||||||||||||||
| 49 | |||||||||||||||
| 50 | 15 | 1; | |||||||||||||
| 51 | |||||||||||||||
| 52 | __END__ | ||||||||||||||