Class: BitBucket::Client::Repos::PullRequests::Comments

Inherits:
API
  • Object
show all
Defined in:
lib/bitbucket_rest_api/client/repos/pull_requests/comments.rb

Constant Summary

Constants included from Validations

Validations::VALID_API_KEYS

Constants included from Validations::Token

Validations::Token::TOKEN_REQUIRED, Validations::Token::TOKEN_REQUIRED_REGEXP

Constants included from BitBucket::Constants

BitBucket::Constants::ACCEPT, BitBucket::Constants::ACCEPT_CHARSET, BitBucket::Constants::CACHE_CONTROL, BitBucket::Constants::CONTENT_LENGTH, BitBucket::Constants::CONTENT_TYPE, BitBucket::Constants::DATE, BitBucket::Constants::ETAG, BitBucket::Constants::LOCATION, BitBucket::Constants::META_FIRST, BitBucket::Constants::META_LAST, BitBucket::Constants::META_NEXT, BitBucket::Constants::META_PREV, BitBucket::Constants::META_REL, BitBucket::Constants::PARAM_PAGE, BitBucket::Constants::PARAM_START_PAGE, BitBucket::Constants::QUERY_STR_SEP, BitBucket::Constants::RATELIMIT_LIMIT, BitBucket::Constants::RATELIMIT_REMAINING, BitBucket::Constants::SERVER, BitBucket::Constants::USER_AGENT

Instance Attribute Summary

Attributes inherited from API

#current_options

Instance Method Summary collapse

Methods inherited from API

#_merge_user_into_params!, #_merge_user_repo_into_params!, #_update_user_repo_params, #api_methods_in, #append_arguments, #arguments, extract_class_name, inherited, #initialize, #method_missing, namespace, #process_basic_auth, #set, #set_api_client, #setup, #with, #yield_or_eval

Methods included from BitBucket::ClassMethods

#configuration, #configure, #require_all

Methods included from Normalizer

#normalize!

Methods included from ParameterFilter

#filter!

Methods included from Validations::Required

#assert_required_keys

Methods included from Validations::Token

#validates_token_for

Methods included from Validations::Format

#assert_valid_values

Methods included from Validations::Presence

#assert_presence_of

Methods included from Request::Verbs

#delete_request, #get_request, #options_request, #patch_request, #post_request, #put_request

Methods included from Authorization

#authenticated?, #authentication, #basic_authed?

Constructor Details

This class inherits a constructor from BitBucket::API

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BitBucket::API

Instance Method Details

#get(*args) ⇒ Object Also known as: find

Gets a single comment

Examples

@bitbucket = BitBucket.new
@bitbucket.repos.pull_requests.comments.get 'user-name', 'repo-name', 'pull-request-id')


31
32
33
34
35
36
37
38
39
# File 'lib/bitbucket_rest_api/client/repos/pull_requests/comments.rb', line 31

def get(*args)
  arguments(args, required: [:user, :repo, :pull_request_id, :comment_id])
  user            = arguments.user
  repo            = arguments.repo
  pull_request_id = arguments.pull_request_id
  comment_id      = arguments.comment_id

  get_request("/repositories/#{user}/#{repo.downcase}/pullrequests/#{pull_request_id}/comments/#{comment_id}")
end

#list(*args) ⇒ Object Also known as: all

List comments on a pull request

Examples

bitbucket = BitBucket.new
bitbucket.repos.pull_requests.comments.all 'user-name', 'repo-name', 'pull-request-id'


13
14
15
16
17
18
19
20
21
22
# File 'lib/bitbucket_rest_api/client/repos/pull_requests/comments.rb', line 13

def list(*args)
  arguments(args, required: [:user, :repo, :pull_request_id])
  user            = arguments.user
  repo            = arguments.repo
  pull_request_id = arguments.pull_request_id

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