| 1 | package Net::GitHub::V3::Gists; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = '1.03'; | |||||||||
| 6 | 1 | our $AUTHORITY = 'cpan:FAYLAND'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use URI::Escape; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | with 'Net::GitHub::V3::Query'; | |||||||||
| 11 | |||||||||||
| 12 | sub gists { | ||||||||||
| 13 | 0 | ▶ | my ( $self, $user ) = @_; | ||||||||
|
Subroutine
gists: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/gists' : '/gists'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | return $self->query($u); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub next_gist { | ||||||||||
| 20 | 0 | ▶ | my ( $self, $user ) = @_; | ||||||||
|
Subroutine
next_gist: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/gists' : '/gists'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | return $self->next($u); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | sub close_gist { | ||||||||||
| 27 | 0 | ▶ | my ( $self, $user ) = @_; | ||||||||
|
Subroutine
close_gist: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | my $u = $user ? "/users/" . uri_escape($user) . '/gists' : '/gists'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | return $self->close($u); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | ## build methods on fly | ||||||||||
| 34 | 1 | my %__methods = ( | |||||||||
| 35 | public_gists => { url => "/gists/public", paginate => 1 }, | ||||||||||
| 36 | starred_gists => { url => "/gists/starred", paginate => 1 }, | ||||||||||
| 37 | gist => { url => "/gists/%s" }, | ||||||||||
| 38 | create => { url => "/gists", method => "POST", args => 1 }, | ||||||||||
| 39 | update => { url => "/gists/%s", method => "PATCH", args => 1 }, | ||||||||||
| 40 | star => { url => "/gists/%s/star", method => "PUT", check_status => 204 }, | ||||||||||
| 41 | unstar => { url => "/gists/%s/star", method => "DELETE", check_status => 204 }, | ||||||||||
| 42 | is_starred => { url => "/gists/%s/star", method => "GET", check_status => 204 }, | ||||||||||
| 43 | fork => { url => "/gists/%s/fork", method => "POST" }, | ||||||||||
| 44 | delete => { url => "/gists/%s", method => "DELETE", check_status => 204 }, | ||||||||||
| 45 | |||||||||||
| 46 | # http://developer.github.com/v3/gists/comments/ | ||||||||||
| 47 | comments => { url => "/gists/%s/comments", paginate => 1 }, | ||||||||||
| 48 | comment => { url => "/gists/%s/comments/%s" }, | ||||||||||
| 49 | create_comment => { url => "/gists/%s/comments", method => 'POST', args => 1 }, | ||||||||||
| 50 | update_comment => { url => "/gists/%s/comments/%s", method => 'PATCH', args => 1 }, | ||||||||||
| 51 | delete_comment => { url => "/gists/%s/comments/%s", method => 'DELETE', check_status => 204 }, | ||||||||||
| 52 | ); | ||||||||||
| 53 | 1 | __build_methods(__PACKAGE__, %__methods); | |||||||||
| 54 | |||||||||||
| 55 | 1 | ▶ | no Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 56 | |||||||||||
| 57 | 1 | 1; | |||||||||
| 58 | __END__ | ||||||||||