class Github::Client::Activity::Watching

discussions, as well as events in the user’s activity feed.
Watching a Repository registers the user to receive notificactions on new

def create(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :ignored (Boolean) --
  • :subscribed (Boolean) --

Parameters:
  • params (Hash) --

Other tags:
    See: https://developer.github.com/v3/activity/watching/#set-a-repository-subscription -
def create(*args)
  arguments(args, required: [:user, :repo])
  put_request("/repos/#{arguments.user}/#{arguments.repo}/subscription", arguments.params)
end

def delete(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription -
def delete(*args)
  arguments(args, required: [:user, :repo])
  delete_request("/repos/#{arguments.user}/#{arguments.repo}/subscription", arguments.params)
end

def list(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#list-watchers -
def list(*args)
  arguments(args, required: [:user, :repo])
  response = get_request("/repos/#{arguments.user}/#{arguments.repo}/subscribers", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def subscribed?(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#get-a-repository-subscription -
def subscribed?(*args)
  arguments(args, required: [:user, :repo])
  get_request("/repos/#{arguments.user}/#{arguments.repo}/subscription", arguments.params)
  true
rescue Github::Error::NotFound
  false
end

def unwatch(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#stop-watching-a-repository-legacy -
def unwatch(*args)
  arguments(args, required: [:user, :repo])
  delete_request("/user/subscriptions/#{arguments.user}/#{arguments.repo}", arguments.params)
end

def watch(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#watch-a-repository-legacy -
def watch(*args)
  arguments(args, required: [:user, :repo])
  put_request("/user/subscriptions/#{arguments.user}/#{arguments.repo}", arguments.params)
end

def watched(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched -
def watched(*args)
  arguments(args)
  params = arguments.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

def watching?(*args)

Other tags:
    Api: - public

Returns:
  • (Boolean) -

Other tags:
    See: https://developer.github.com/v3/activity/watching/#check-if-you-are-watching-a-repository-legacy -
def watching?(*args)
  arguments(args, required: [:user, :repo])
  get_request("/user/subscriptions/#{arguments.user}/#{arguments.repo}", arguments.params)
  true
rescue Github::Error::NotFound
  false
end