Module: Octokit::Client::CommitComments
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/commit_comments.rb
Overview
Methods for the Commit Comments API
Instance Method Summary collapse
-
#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
34 35 36 |
# 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
24 25 26 |
# 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
56 57 58 59 60 61 62 63 64 |
# 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
90 91 92 |
# 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
14 15 16 |
# 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
77 78 79 80 81 82 |
# 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 |