Sha256: e78d3d91ec1f0d82262e4007ab70cbccaf91bda0079f1e533c25b5d9f6300675

Contents?: true

Size: 748 Bytes

Versions: 5

Compression:

Stored size: 748 Bytes

Contents

# encoding: utf-8

module BitBucket
  class Client::Repos::PullRequests::Commits < API
    @version = '2.0'

    # List commits on a pull request
    #
    # = Examples
    #  bitbucket = BitBucket.new
    #  bitbucket.repos.pull_requests.commits.all 'user-name', 'repo-name', 'pull-request-id'
    #
    def list(user_name, repo_name, pull_request_id)
      _update_user_repo_params(user_name, repo_name)
      _validate_user_repo_params(user, repo) unless user? && repo?
      _validate_presence_of pull_request_id

      response = get_request("/repositories/#{user}/#{repo.downcase}/pullrequests/#{pull_request_id}/commits")
      return response unless block_given?
      response.each { |el| yield el }
    end
    alias :all :list
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

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