Module: Octokit::Client::Gists
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/gists.rb |
Overview
Methods for the Gists
API
Instance Method Summary
-
#create_gist(options = {}) ⇒ Sawyer::Resource
Create a gist.
-
#create_gist_comment(gist_id, comment, options = {}) ⇒ Sawyer::Resource
Create gist comment.
-
#delete_gist(gist, options = {}) ⇒ Boolean
Delete a gist.
-
#delete_gist_comment(gist_id, gist_comment_id, options = {}) ⇒ Boolean
Delete gist comment.
-
#edit_gist(gist, options = {}) ⇒ Object
Edit a gist.
-
#fork_gist(gist, options = {}) ⇒ Sawyer::Resource
Fork a gist.
-
#gist(gist, options = {}) ⇒ Sawyer::Resource
Get a single gist.
-
#gist_comment(gist_id, gist_comment_id, options = {}) ⇒ Sawyer::Resource
Get gist comment.
-
#gist_comments(gist_id, options = {}) ⇒ Array<Sawyer::Resource>
List gist comments.
-
#gist_commits(gist, options = {}) ⇒ Array
List gist commits.
-
#gist_forks(gist, options = {}) ⇒ Array
List gist forks.
-
#gist_starred?(gist, options = {}) ⇒ Boolean
Check if a gist is starred.
-
#gists(user = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_gists)
List gists for a user or all public gists.
-
#list_gists(user = nil, options = {})
Alias for #gists.
-
#public_gists(options = {}) ⇒ Array<Sawyer::Resource>
List public gists.
-
#star_gist(gist, options = {}) ⇒ Boolean
Star a gist.
-
#starred_gists(options = {}) ⇒ Array<Sawyer::Resource>
List the authenticated user’s starred gists.
-
#unstar_gist(gist, options = {}) ⇒ Boolean
Unstar a gist.
-
#update_gist_comment(gist_id, gist_comment_id, comment, options = {}) ⇒ Sawyer::Resource
Update gist comment.
Instance Method Details
#create_gist(options = {}) ⇒ Sawyer::Resource
Create a gist
# File 'lib/octokit/client/gists.rb', line 71
def create_gist( = {}) post 'gists', end
#create_gist_comment(gist_id, comment, options = {}) ⇒ Sawyer::Resource
Create gist comment
Requires authenticated client.
# File 'lib/octokit/client/gists.rb', line 198
def create_gist_comment(gist_id, comment, = {}) = .merge({ body: comment }) post "gists/#{gist_id}/comments", end
#delete_gist(gist, options = {}) ⇒ Boolean
Delete a gist
#delete_gist_comment(gist_id, gist_comment_id, options = {}) ⇒ Boolean
Delete gist comment
Requires authenticated client.
# File 'lib/octokit/client/gists.rb', line 229
def delete_gist_comment(gist_id, gist_comment_id, = {}) boolean_from_response(:delete, "gists/#{gist_id}/comments/#{gist_comment_id}", ) end
#edit_gist(gist, options = {}) ⇒ Object
Edit a gist
#fork_gist(gist, options = {}) ⇒ Sawyer::Resource
Fork a gist
#gist(gist, options = {}) ⇒ Sawyer::Resource
Get a single gist
#gist_comment(gist_id, gist_comment_id, options = {}) ⇒ Sawyer::Resource
Get gist comment
# File 'lib/octokit/client/gists.rb', line 184
def gist_comment(gist_id, gist_comment_id, = {}) get "gists/#{gist_id}/comments/#{gist_comment_id}", end
#gist_comments(gist_id, options = {}) ⇒ Array
<Sawyer::Resource
>
List gist comments
# File 'lib/octokit/client/gists.rb', line 172
def gist_comments(gist_id, = {}) paginate "gists/#{gist_id}/comments", end
#gist_commits(gist, options = {}) ⇒ Array
List gist commits
#gist_forks(gist, options = {}) ⇒ Array
List gist forks
#gist_starred?(gist, options = {}) ⇒ Boolean
Check if a gist is starred
#gists(user = nil, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #list_gists
List gists for a user or all public gists
#list_gists(user = nil, options = {})
Alias for #gists.
# File 'lib/octokit/client/gists.rb', line 25
alias list_gists gists
#public_gists(options = {}) ⇒ Array
<Sawyer::Resource
>
List public gists
# File 'lib/octokit/client/gists.rb', line 33
def public_gists( = {}) paginate 'gists/public', end
#star_gist(gist, options = {}) ⇒ Boolean
Star a gist
#starred_gists(options = {}) ⇒ Array
<Sawyer::Resource
>
List the authenticated user’s starred gists
# File 'lib/octokit/client/gists.rb', line 41
def starred_gists( = {}) paginate 'gists/starred', end
#unstar_gist(gist, options = {}) ⇒ Boolean
Unstar a gist
#update_gist_comment(gist_id, gist_comment_id, comment, options = {}) ⇒ Sawyer::Resource
Update gist comment
Requires authenticated client
# File 'lib/octokit/client/gists.rb', line 214
def update_gist_comment(gist_id, gist_comment_id, comment, = {}) = .merge({ body: comment }) patch "gists/#{gist_id}/comments/#{gist_comment_id}", end