class Github::Client::Gists::Comments

Public Instance Methods

all(*args)
Alias for: list
create(*args) click to toggle source

Create a comment

@see developer.github.com/v3/gists/comments/#create-a-comment

@param [Hash] params @option params [String] :body

Required. The comment text.

@example

github = Github.new
github.gists.comments.create 'gist-id'

@api public

# File lib/github_api/client/gists/comments.rb, line 58
def create(*args)
  arguments(args, required: [:gist_id])

  post_request("/gists/#{arguments.gist_id}/comments", arguments.params)
end
delete(*args) click to toggle source

Delete a comment

@see developer.github.com/v3/gists/comments/#delete-a-comment

@example

github = Github.new
github.gists.comments.delete 'gist-id', 'comment-id'

@api public

# File lib/github_api/client/gists/comments.rb, line 93
def delete(*args)
  arguments(args, required: [:gist_id, :id])

  delete_request("/gists/#{arguments.gist_id}/comments/#{arguments.id}",
                 arguments.params)
end
edit(*args) click to toggle source

Edit a comment

@see developer.github.com/v3/gists/comments/#edit-a-comment

@param [Hash] params @option params [String] :body

Required. The comment text.

@example

github = Github.new
github.gists.comments.edit 'gist-id', 'comment-id'

@api public

# File lib/github_api/client/gists/comments.rb, line 77
def edit(*args)
  arguments(args, required: [:gist_id, :id])

  patch_request("/gists/#{arguments.gist_id}/comments/#{arguments.id}",
                arguments.params)
end
find(*args)
Alias for: get
get(*args) click to toggle source

Get a single comment

@see developer.github.com/v3/gists/comments/#get-a-single-comment

@example

github = Github.new
github.gists.comments.get 'gist-id', 'comment-id'

@api public

# File lib/github_api/client/gists/comments.rb, line 37
def get(*args)
  arguments(args, required: [:gist_id, :id])

  get_request("/gists/#{arguments.gist_id}/comments/#{arguments.id}",
              arguments.params)
end
Also aliased as: find
list(*args) { |el| ... } click to toggle source

List comments on a gist

@see developer.github.com/v3/gists/comments/#list-comments-on-a-gist

@example

github = Github.new
github.gists.comments.list 'gist-id'

@return [Hash]

@api public

# File lib/github_api/client/gists/comments.rb, line 18
def list(*args)
  arguments(args, required: [:gist_id])

  response = get_request("/gists/#{arguments.gist_id}/comments",
                         arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end
Also aliased as: all