class Github::Issues::Comments

def create(user_name, repo_name, issue_id, params={})


'body': 'a new comment'
github.issues.comments.create 'user-name', 'repo-name', 'issue-id',
github = Github.new
= Examples

:body Required string
= Inputs

Create a comment
def create(user_name, repo_name, issue_id, params={})
  set :user => user_name, :repo => repo_name
  assert_presence_of user, repo, issue_id
  normalize! params
  filter! VALID_ISSUE_COMMENT_PARAM_NAME, params
  assert_required_keys(%w[ body ], params)
  post_request("/repos/#{user}/#{repo}/issues/#{issue_id}/comments", params)
end

def delete(user_name, repo_name, comment_id, params={})


github.issues.comments.delete 'user-name', 'repo-name', 'comment-id'
github = Github.new
= Examples

Delete a comment
def delete(user_name, repo_name, comment_id, params={})
  set :user => user_name, :repo => repo_name
  assert_presence_of user, repo, comment_id
  normalize! params
  delete_request("/repos/#{user}/#{repo}/issues/comments/#{comment_id}", params)
end

def edit(user_name, repo_name, comment_id, params={})


'body': 'a new comment'
github.issues.comments.edit 'user-name', 'repo-name', 'comment-id',
github = Github.new
= Examples

:body Required string
= Inputs

Edit a comment
def edit(user_name, repo_name, comment_id, params={})
  set :user => user_name, :repo => repo_name
  assert_presence_of user, repo, comment_id
  normalize! params
  filter! VALID_ISSUE_COMMENT_PARAM_NAME, params
  assert_required_keys(%w[ body ], params)
  patch_request("/repos/#{user}/#{repo}/issues/comments/#{comment_id}", params)
end

def get(user_name, repo_name, comment_id, params={})


github.issues.comments.find 'user-name', 'repo-name', 'comment-id'
github = Github.new
= Examples

Get a single comment
def get(user_name, repo_name, comment_id, params={})
  set :user => user_name, :repo => repo_name
  assert_presence_of user, repo, comment_id
  normalize! params
  get_request("/repos/#{user}/#{repo}/issues/comments/#{comment_id}", params)
end

def list(user_name, repo_name, params={})


github.issues.comments.all 'user-name', 'repo-name' {|com| .. }
github.issues.comments.all 'user-name', 'repo-name'
github = Github.new
= Examples

format: YYYY-MM-DDTHH:MM:SSZ
* :since - Optional string of a timestamp in ISO 8601
Ignored with sort parameter.
* :direction - Optional string, asc or desc.
* :sort - Optional string, created or updated
= Parameters

List comments in a repository

github.issues.comments.all 'user-name', 'repo-name', issue_id: 'id' {|com| .. }
github.issues.comments.all 'user-name', 'repo-name', issue_id: 'id'
github = Github.new
= Examples

List comments on an issue
def list(user_name, repo_name, params={})
  set :user => user_name, :repo => repo_name
  assert_presence_of user, repo
  normalize! params
  response = if (issue_id = params.delete('issue_id'))
    get_request("/repos/#{user}/#{repo}/issues/#{issue_id}/comments", params)
  else
    get_request("/repos/#{user}/#{repo}/issues/comments", params)
  end
  return response unless block_given?
  response.each { |el| yield el }
end