module

Octokit::Client::Users

Methods for the Users API

See Also:

Instance methods

add_email(email)

Add email address to user.

Example:

@client.add_email("new_email@user.com")

Note: Requires authenticated client.

See Also:

Source
add_key(title, key)

Add public key to user account.

Example:

@client.add_key("Personal projects key", "ssh-rsa AAA...")

Note: Requires authenticated client.

See Also:

Source
all_users

List all GitHub users

This provides a list of every user, in the order that they signed up for GitHub.

See Also:

Source
emails

List email addresses for a user.

Example:

@client.emails

Note: Requires an authenticated client.

See Also:

Source
exchange_code_for_token(code, app_id = client_id, app_secret = client_secret)

Retrieve access token

Example:

Octokit.client.exchange_code_for_token("aaaa", "xxxx", "yyyy", {accept: "application/json"})

See Also:

Source
follow(user)

Follow a user.

Example:

@client.follow("monalisa")

Note: Requires an authenticated user.

See Also:

Source
followers(user, **options)

Get a user's followers

Example:

Octokit.client.followers("monalisa")

See Also:

Source
following(user, **options)

Get a list of users the user is following

Example:

Octokit.client.following("monalisa")

See Also:

Source
follows?(user, target = nil)

Check if you is following a user. Alternatively check if a given user is following a target user.

Examples:

@client.follows?("asterite")
@client.follows?("asterite", "waj")

Note: Requires an authenticated user.

See Also:

Source
key(key_id)

Get a public key.

Examples:

@client.key(1)

# Retrieve public key contents
public_key = @client.key(1)
public_key.key
# => Error

public_key[:key]
# => "ssh-rsa AAA..."

Note: when using dot notation to retrieve the values, ruby will return the hash key for the public keys value instead of the actual value, use symbol or key string to retrieve the value. See example.

Note: Requires an authenticated client.

See Also:

Source
keys(user = nil)

Get a list of public keys for a user.

Examples:

@client.keys
@client.keys("monalisa")

Note: Requires an authenticated client.

See Also:

Source
public_emails

List public email addresses for a user.

Example:

@client.public_emails

Note: Requires an authenticated client.

See Also:

Source
remove_email(email)

Remove email from user.

Example:

@client.remove_email("old_email@user.com")

Note: Requires authenticated client.

See Also:

Source
remove_key(id)

Delete a public key.

Example:

@client.remove_key(1)

Note: Requires an authenticated client.

See Also:

Source
starred(user = login, **options)

Get a list of repos starred by a user.

Example:

Octokit.client.starred("monalisa")

See Also:

Source
starred?(repo)

Check if you are starring a repo.

Example:

@client.starred?("watzon/octokit")

Note: Requires an authenticated client.

See Also:

Source
subscriptions(user = login, **options)

List repositories being watched by a user.

Example:

@client.subscriptions("monalisa")

See Also:

Source
toggle_email_visibility(options)

Toggle the visibility of the users primary email addresses.

Example:

@client.toggle_email_visibility([{email: "email@user.com", visibility: "private"}])

Note: Requires authenticated client.

See Also:

Source
unfollow(user)

Unfollow a user.

Example:

@client.unfollow("monalisa")

Note: Requires an authenticated user.

See Also:

Source
update_user

Update the authenticated user

Example:

Octokit.client.update_user(name: "Chris Watson", email: "cawatson1993@gmail.com", company: "Manas Tech", location: "Buenos Aires", hireable: false)

See Also:

Source
validate_credentials(options = nil)

Validate user username and password

Source