Module: GithubApi::Client::Labels

Included in:
GithubApi::Client
Defined in:
lib/tractive/github_api/client/labels.rb

Instance Method Summary collapse

Instance Method Details

#create_label(repo, params) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tractive/github_api/client/labels.rb', line 19

def create_label(repo, params)
  JSON.parse(
    Http::Client::Request.post(
      "https://api.github.com/repos/#{repo}/labels",
      params.to_json,
      {
        "Authorization" => "token #{@token}",
        "Accept" => "application/vnd.github.v3+json"
      }
    )
  )
end

#list_labels(repo, params = {}) ⇒ Object Also known as: labels



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tractive/github_api/client/labels.rb', line 6

def list_labels(repo, params = {})
  JSON.parse(
    Http::Client::Request.get(
      "https://api.github.com/repos/#{repo}/labels",
      {
        "Authorization" => "token #{@token}",
        params: params
      }
    )
  )
end