Sha256: b5fb6428948c113ed36c518ea7f23e7fc11479266636c18fbbace0b38aef4026

Contents?: true

Size: 760 Bytes

Versions: 6

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true

module GithubApi
  class Client
    module Labels
      def list_labels(repo, params = {})
        JSON.parse(
          RestClient.get(
            "https://api.github.com/repos/#{repo}/labels",
            {
              "Authorization" => "token #{@token}",
              params: params
            }
          )
        )
      end
      alias labels list_labels

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tractive-1.0.9 lib/tractive/github_api/client/labels.rb
tractive-1.0.8 lib/tractive/github_api/client/labels.rb
tractive-1.0.7 lib/tractive/github_api/client/labels.rb
tractive-1.0.6 lib/tractive/github_api/client/labels.rb
tractive-1.0.5 lib/tractive/github_api/client/labels.rb
tractive-1.0.4 lib/tractive/github_api/client/labels.rb