Method: Github::Activity::Watching#watched

Defined in:
lib/github_api/activity/watching.rb

#watched(*args) ⇒ Object

List repos being watched by a user

Examples

github = Github.new
github.activity.watching.watched :user => 'user-name'

List repos being watched by the authenticated user

Examples

github = Github.new :oauth_token => '...'
github.activity.watching.watched


36
37
38
39
40
41
42
43
44
45
46
# File 'lib/github_api/activity/watching.rb', line 36

def watched(*args)
  params = arguments(args).params

  response = if (user_name = params.delete('user'))
    get_request("/users/#{user_name}/subscriptions", params)
  else
    get_request("/user/subscriptions", params)
  end
  return response unless block_given?
  response.each { |el| yield el }
end