Create a key
@param [Hash] params @option params [String] :title
Required string.
@option params [String] :key
Required string.
@example
github = Github.new github.repos.keys.create 'user-name', 'repo-name', title: "octocat@octomac", key: "ssh-rsa AAA..."
@api public
# File lib/github_api/client/repos/keys.rb, line 57 def create(*args) arguments(args, required: [:user, :repo]) do permit VALID_KEY_OPTIONS assert_required VALID_KEY_OPTIONS end post_request("/repos/#{arguments.user}/#{arguments.repo}/keys", arguments.params) end
Delete key
@example
github = Github.new github.repos.keys.delete 'user-name', 'repo-name', 'key-id'
@api public
# File lib/github_api/client/repos/keys.rb, line 73 def delete(*args) arguments(args, required: [:user, :repo, :id]) params = arguments.params delete_request("/repos/#{arguments.user}/#{arguments.repo}/keys/#{arguments.id}", params) end
Get a key
@example
github = Github.new github.repos.keys.get 'user-name', 'repo-name', 'key-id'
@api public
# File lib/github_api/client/repos/keys.rb, line 35 def get(*args) arguments(args, :required => [:user, :repo, :id]) get_request("/repos/#{arguments.user}/#{arguments.repo}/keys/#{arguments.id}", arguments.params) end
List deploy keys
@example
github = Github.new github.repos.keys.list 'user-name', 'repo-name' github.repos.keys.list 'user-name', 'repo-name' { |key| ... }
@example
keys = Github::Repos::Keys.new user: 'user-name', repo: 'repo-name' keys.list
@api public
# File lib/github_api/client/repos/keys.rb, line 19 def list(*args) arguments(args, required: [:user, :repo]) response = get_request("/repos/#{arguments.user}/#{arguments.repo}/keys", arguments.params) return response unless block_given? response.each { |el| yield el } end
Generated with the Darkfish Rdoc Generator 2.