Sha256: bcca8886f5c5f1accc7edc00cb48ccc2a1a6e6376f13c4d8d9c5667ccf5ed4c7

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

module BitBucket
  class Client::Repos::Following < API
    @version = '1.0'

    # List repo followers
    #
    # = Examples
    #  bitbucket = BitBucket.new :user => 'user-name', :repo => 'repo-name'
    #  bitbucket.repos.following.followers
    #  bitbucket.repos.following.followers { |watcher| ... }
    #
    def followers(user_name, repo_name, params={})
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      normalize! params

      response = get_request("/repositories/#{user}/#{repo.downcase}/followers/", params)
      return response unless block_given?
      response.each { |el| yield el }
    end

    # List repos being followed by the authenticated user
    #
    # = Examples
    #  bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
    #  bitbucket.repos.following.followed
    #
    def followed(*args)
      params = args.extract_options!
      normalize! params

      response = get_request("/user/follows", params)
      return response unless block_given?
      response.each { |el| yield el }
    end

  end # Repos::Watching
end # BitBucket

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
codenamev_bitbucket_api-0.4.1 lib/bitbucket_rest_api/client/repos/following.rb
codenamev_bitbucket_api-0.4.0 lib/bitbucket_rest_api/client/repos/following.rb
reenhanced_bitbucket_api-0.3.2 lib/bitbucket_rest_api/client/repos/following.rb
reenhanced_bitbucket_api-0.3.1 lib/bitbucket_rest_api/client/repos/following.rb
reenhanced_bitbucket_api-0.3.0 lib/bitbucket_rest_api/client/repos/following.rb