class Github::Users::Keys
def create(params={})
"key" => "ssh-rsa AAA..."
github.users.keys.create "title" => "octocat@octomac",
github = Github.new :oauth_token => '...'
= Examples
* :key - Required string. sha key
* :title - Required string
= Inputs
Create a public key for the authenticated user
def create(params={}) normalize! params filter! VALID_KEY_PARAM_NAMES, params post_request("/user/keys", params) end
def delete(key_id, params={})
github.users.keys.delete 'key-id'
github = Github.new :oauth_token => '...'
= Examples
Delete a public key for the authenticated user
def delete(key_id, params={}) assert_presence_of key_id normalize! params delete_request("/user/keys/#{key_id}", params) end
def get(key_id, params={})
github.users.keys.get 'key-id'
github = Github.new :oauth_token => '...'
= Examples
Get a single pulic key for the authenticated user
def get(key_id, params={}) assert_presence_of key_id normalize! params get_request("/user/keys/#{key_id}", params) end
def list(params={})
github.users.keys.list { |key| ... }
github.users.keys.list
github = Github.new :oauth_token => '...'
= Examples
List public keys for the authenticated user
def list(params={}) normalize! params response = get_request("/user/keys", params) return response unless block_given? response.each { |el| yield el } end
def update(key_id, params={})
"key" => "ssh-rsa AAA..."
github.users.keys.update 'key-id', "title" => "octocat@octomac",
github = Github.new :oauth_token => '...'
= Examples
* :key - Required string. sha key
* :title - Required string
= Inputs
Update a public key for the authenticated user
def update(key_id, params={}) assert_presence_of key_id normalize! params filter! VALID_KEY_PARAM_NAMES, params patch_request("/user/keys/#{key_id}", params) end