module Github::Users::Followers
def follow(user_name, params={})
@github.users.follow 'user-name'
@github = Github.new :oauth_token => '...'
= Examples
Follow a user
def follow(user_name, params={}) _validate_presence_of user_name _normalize_params_keys(params) put("/user/following/#{user_name}", params) end
def followers(user_name=nil, params={})
@github.users.followers { |user| ... }
@github.users.followers
@github = Github.new :oauth_token => '...'
= Examples
List the authenticated user's followers
@github.users.followers 'user-name' { |user| ... }
@github.users.followers 'user-name'
@github = Github.new
= Examples
List a user's followers
def followers(user_name=nil, params={}) _normalize_params_keys(params) response = if user_name get("/users/#{user_name}/followers", params) else get("/user/followers", params) end return response unless block_given? response.each { |el| yield el } end
def following(user_name=nil, params={})
@github.users.following
@github = Github.new :oauth_token => '...'
= Examples
List who the authenicated user is following
@github.users.following 'user-name' { |user| ... }
@github.users.following 'user-name'
@github = Github.new
= Examples
List who a user is following
def following(user_name=nil, params={}) _normalize_params_keys(params) response = if user_name get("/users/#{user_name}/following", params) else get("/user/following", params) end return response unless block_given? response.each { |el| yield el } end
def following?(user_name, params={})
@github.users.following? 'user-name'
@github = Github.new :oauth_token => '...'
= Examples
Check if you are following a user
def following?(user_name, params={}) _validate_presence_of user_name _normalize_params_keys(params) get("/user/following/#{user_name}", params) true rescue Github::Error::NotFound false end
def unfollow(user_name, params={})
@github.users.unfollow 'user-name'
@github = Github.new :oauth_token => '...'
= Examples
Unfollow a user
def unfollow(user_name, params={}) _validate_presence_of user_name _normalize_params_keys(params) delete("/user/following/#{user_name}", params) end