Method: Github::Client::Authorizations#create

Defined in:
lib/github_api2/client/authorizations.rb

#create(*args) ⇒ Object

Create a new authorization

Examples:

github = Github.new basic_auth: 'login:password'
github.oauth.create scopes: ["public_repo"], note: 'amdmin script'

Parameters:

See Also:



77
78
79
80
81
82
83
84
# File 'lib/github_api2/client/authorizations.rb', line 77

def create(*args)
  raise_authentication_error unless authenticated?
  arguments(args) do
    assert_required :note, :scopes
  end

  post_request('/authorizations', arguments.params)
end