Module: Octokit::Client::CommitComments
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/commit_comments.rb |
Overview
Methods for the Commit Comments API
Instance Method Summary
-
#commit_comment(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single commit comment.
-
#commit_comments(repo, sha, options = {}) ⇒ Array
List comments for a single commit.
-
#create_commit_comment(repo, sha, body, path = nil, line = nil, position = nil, options = {}) ⇒ Sawyer::Resource
Create a commit comment.
-
#delete_commit_comment(repo, id, options = {}) ⇒ Boolean
Delete a commit comment.
-
#list_commit_comments(repo, options = {}) ⇒ Array
List all commit comments.
-
#update_commit_comment(repo, id, body, options = {}) ⇒ Sawyer::Resource
Update a commit comment.
Instance Method Details
#commit_comment(repo, id, options = {}) ⇒ Sawyer::Resource
Get a single commit comment
# File 'lib/octokit/client/commit_comments.rb', line 34
def commit_comment(repo, id, = {}) get "#{Repository.path repo}/comments/#{id}", end
#commit_comments(repo, sha, options = {}) ⇒ Array
List comments for a single commit
# File 'lib/octokit/client/commit_comments.rb', line 24
def commit_comments(repo, sha, = {}) paginate "#{Repository.path repo}/commits/#{sha}/comments", end
#create_commit_comment(repo, sha, body, path = nil, line = nil, position = nil, options = {}) ⇒ Sawyer::Resource
Create a commit comment
# File 'lib/octokit/client/commit_comments.rb', line 56
def create_commit_comment(repo, sha, body, path = nil, line = nil, position = nil, = {}) params = { body: body, path: path, line: line, position: position } post "#{Repository.path repo}/commits/#{sha}/comments", .merge(params) end
#delete_commit_comment(repo, id, options = {}) ⇒ Boolean
Delete a commit comment
# File 'lib/octokit/client/commit_comments.rb', line 90
def delete_commit_comment(repo, id, = {}) boolean_from_response :delete, "#{Repository.path repo}/comments/#{id}", end
#list_commit_comments(repo, options = {}) ⇒ Array
List all commit comments
# File 'lib/octokit/client/commit_comments.rb', line 14
def list_commit_comments(repo, = {}) paginate "#{Repository.path repo}/comments", end
#update_commit_comment(repo, id, body, options = {}) ⇒ Sawyer::Resource
Update a commit comment
# File 'lib/octokit/client/commit_comments.rb', line 77
def update_commit_comment(repo, id, body, = {}) params = { body: body } patch "#{Repository.path repo}/comments/#{id}", .merge(params) end