class Github::Gists::Comments

Constants

REQUIRED_GIST_COMMENT_OPTIONS
VALID_GIST_COMMENT_OPTIONS

Public Instance Methods

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

Create a comment

Examples

github = Github.new
github.gists.comments.create 'gist-id'
# File lib/github_api/gists/comments.rb, line 49
def create(*args)
  arguments(args, :required => [:gist_id]) do
    sift VALID_GIST_COMMENT_OPTIONS
    assert_required REQUIRED_GIST_COMMENT_OPTIONS
  end

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

Delete a comment

Examples

github = Github.new
github.gists.comments.delete 'gist-id', 'comment-id'
# File lib/github_api/gists/comments.rb, line 79
def delete(*args)
  arguments(args, :required => [:gist_id, :comment_id])

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

Edit a comment

Examples

github = Github.new
github.gists.comments.edit 'gist-id', 'comment-id'
# File lib/github_api/gists/comments.rb, line 64
def edit(*args)
  arguments(args, :required => [:gist_id, :comment_id]) do
    sift VALID_GIST_COMMENT_OPTIONS
    assert_required REQUIRED_GIST_COMMENT_OPTIONS
  end

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

Get a single comment

Examples

github = Github.new
github.gists.comments.get 'gist-id', 'comment-id'
# File lib/github_api/gists/comments.rb, line 36
def get(*args)
  arguments(args, :required => [:gist_id, :comment_id])

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

List comments on a gist

Examples

github = Github.new
github.gists.comments.list 'gist-id'
# File lib/github_api/gists/comments.rb, line 21
def list(*args)
  arguments(args, :required => [:gist_id])

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