Method: Github::Repos::Keys#create

Defined in:
lib/github_api/repos/keys.rb

#create(*args) ⇒ Object

Create a key

Inputs

  • :title - Required string.

  • :key - Required string.

Examples

github = Github.new
github.repos.keys.create 'user-name', 'repo-name',
  "title" => "octocat@octomac",
  "key" =>  "ssh-rsa AAA..."


52
53
54
55
56
57
58
59
# File 'lib/github_api/repos/keys.rb', line 52

def create(*args)
  arguments(args, :required => [:user, :repo]) do
    sift VALID_KEY_OPTIONS
    assert_required VALID_KEY_OPTIONS
  end

  post_request("/repos/#{user}/#{repo}/keys", arguments.params)
end