Method: Github::Authorizations::App#create

Defined in:
lib/github_api/authorizations/app.rb

#create(*args) ⇒ Object

Get-or-create an authorization for a specific app

Examples:

github = Github.new
github.oauth.app.create 'client-id', client_secret: '...'

Parameters:



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/github_api/authorizations/app.rb', line 25

def create(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:client_id]) do
    sift Authorizations::VALID_AUTH_PARAM_NAMES
  end

  if client_id
    put_request("/authorizations/clients/#{client_id}", arguments.params)
  else
    raise raise_app_authentication_error
  end
end