Sha256: 4f665e87dce1ab895d9b6f54fd23047c3d3bc2bd7f78e77a8e08091eae996ac9

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

# encoding: utf-8

module BitBucket
  class Repos::Following < API

    # 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

4 entries across 4 versions & 2 rubygems

Version Path
reenhanced_bitbucket_api-0.1.6 lib/bitbucket_rest_api/repos/following.rb
bitbucket_rest_api-0.1.5 lib/bitbucket_rest_api/repos/following.rb
bitbucket_rest_api-0.1.4 lib/bitbucket_rest_api/repos/following.rb
bitbucket_rest_api-0.1.2 lib/bitbucket_rest_api/repos/following.rb