Module: Octokit::Client::Reactions

Included in:
Octokit::Client
Defined in:
lib/octokit/client/reactions.rb

Overview

Methods for the Reacions API

Instance Method Summary collapse

Instance Method Details

#commit_comment_reactions(repo, id, options = {}) ⇒ Array<Sawyer::Resource>

List reactions for a commit comment

Examples:

@client.commit_comment_reactions("octokit/octokit.rb", 1)

See Also:


19
20
21
22
# File 'lib/octokit/client/reactions.rb', line 19

def commit_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/comments/#{id}/reactions", options
end

#create_commit_comment_reaction(repo, id, reaction, options = {}) ⇒ <Sawyer::Resource>

Create a reaction for a commit comment


36
37
38
39
# File 'lib/octokit/client/reactions.rb', line 36

def create_commit_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/comments/#{id}/reactions", options
end

#create_issue_comment_reaction(repo, id, reaction, options = {}) ⇒ <Sawyer::Resource>

Create reaction for an issue comment


103
104
105
106
# File 'lib/octokit/client/reactions.rb', line 103

def create_issue_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/issues/comments/#{id}/reactions", options
end

#create_issue_reaction(repo, number, reaction, options = {}) ⇒ <Sawyer::Resource>

Create reaction for an issue


69
70
71
72
# File 'lib/octokit/client/reactions.rb', line 69

def create_issue_reaction(repo, number, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/issues/#{number}/reactions", options
end

#create_pull_request_review_comment_reaction(repo, id, reaction, options = {}) ⇒ <Sawyer::Resource>

Create reaction for a pull request review comment


137
138
139
140
# File 'lib/octokit/client/reactions.rb', line 137

def create_pull_request_review_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/pulls/comments/#{id}/reactions", options
end

#delete_reaction(id, options = {}) ⇒ Boolean

Delete a reaction

Examples:

@client.delete_reaction(1)

See Also:


152
153
154
155
# File 'lib/octokit/client/reactions.rb', line 152

def delete_reaction(id, options = {})
  options = ensure_api_media_type(:reactions, options)
  boolean_from_response :delete, "reactions/#{id}", options
end

#issue_comment_reactions(repo, id, options = {}) ⇒ Array<Sawyer::Resource>

List reactions for an issue comment

Examples:

@client.issue_comment_reactions("octokit/octokit.rb", 1)

See Also:


85
86
87
88
# File 'lib/octokit/client/reactions.rb', line 85

def issue_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/issues/comments/#{id}/reactions", options
end

#issue_reactions(repo, number, options = {}) ⇒ Array<Sawyer::Resource>

List reactions for an issue

Examples:

@client.issue_reactions("octokit/octokit.rb", 1)

See Also:


51
52
53
54
# File 'lib/octokit/client/reactions.rb', line 51

def issue_reactions(repo, number, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/issues/#{number}/reactions", options
end

#pull_request_review_comment_reactions(repo, id, options = {}) ⇒ Array<Sawyer::Resource>

List reactions for a pull request review comment

Examples:

@client.pull_request_review_comment_reactions("octokit/octokit.rb", 1)

See Also:


119
120
121
122
# File 'lib/octokit/client/reactions.rb', line 119

def pull_request_review_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/pulls/comments/#{id}/reactions", options
end