module Github::Gists::Comments

def comment(comment_id, params={})


@github.gists.comment 'comment-id'
@github = Github.new
= Examples

Get a single comment
def comment(comment_id, params={})
  _normalize_params_keys(params)
  _validate_presence_of(comment_id)
  # _merge_mime_type(:gist_comment, params)
  get("/gists/comments/#{comment_id}", params)
end

def comments(gist_id, params={})


@github.gists.comments 'gist-id'
@github = Github.new
= Examples

List comments on a gist
def comments(gist_id, params={})
  _normalize_params_keys(params)
  _validate_presence_of(gist_id)
  # _merge_mime_type(:gist_comment, params)
  response = get("/gists/#{gist_id}/comments", params)
  return response unless block_given?
  response.each { |el| yield el }
end

def create_comment(gist_id, params={})


@github.gists.create_comment 'gist-id'
@github = Github.new
= Examples

Create a comment
def create_comment(gist_id, params={})
  _normalize_params_keys(params)
  # _merge_mime_type(:gist_comment, params)
  _filter_params_keys(ALLOWED_GIST_COMMENT_INPUTS, params)
  unless _validate_inputs(REQUIRED_GIST_COMMENT_INPUTS, params)
    raise ArgumentError, "Required inputs are: :body"
  end
  post("/gists/#{gist_id}/comments", params)
end

def delete_comment(comment_id, params={})


@github.gists.delete_comment 'comment-id'
@github = Github.new
= Examples

Delete a comment
def delete_comment(comment_id, params={})
  _normalize_params_keys(params)
  _validate_presence_of(comment_id)
  # _merge_mime_type(:gist_comment, params)
  delete("/gists/comments/#{comment_id}", params)
end

def edit_comment(comment_id, params={})


@github.gists.edit_comment 'comment-id'
@github = Github.new
= Examples

Edit a comment
def edit_comment(comment_id, params={})
  _normalize_params_keys(params)
  _validate_presence_of(comment_id)
  # _merge_mime_type(:gist_comment, params)
  _filter_params_keys(ALLOWED_GIST_COMMENT_INPUTS, params)
  unless _validate_inputs(REQUIRED_GIST_COMMENT_INPUTS, params)
    raise ArgumentError, "Required inputs are: :body"
  end
  patch("/gists/comments/#{comment_id}", params)
end