Module: StashCoreAPI::PullRequests

Includes:
Utils
Included in:
StashCoreAPI
Defined in:
lib/stash_core_api/pull_requests.rb

Overview

Interfaces with pull requests endpoints of Stash CoreAPI API

Instance Method Summary collapse

Instance Method Details

#can_merge?(pull_request_id) ⇒ Boolean

TODO:

@raise [StashCoreAPI::Error::Unauthorized] Error raised when supplied user credentials are not valid

Returns true if PR can be merged, false if not.

Parameters:

  • options (Hash)

    A customizable set of options.

  • pull_request_id (Integer)

    the id of the pull request within the repository

Returns:

  • (Boolean)

    Returns true if PR can be merged, false if not.

See Also:



19
20
21
# File 'lib/stash_core_api/pull_requests.rb', line 19

def can_merge?(pull_request_id)
  perform_get("/pull-requests/#{pull_request_id}/merge")['canMerge']
end

#info(pull_request_id) ⇒ Object

TODO:

@raise [StashCoreAPI::Error::Unauthorized] Error raised when supplied user credentials are not valid

Parameters:

  • options (Hash)

    A customizable set of options.

  • pull_request_id (Integer)

    the id of the pull request within the repository

Returns:

See Also:



32
33
34
# File 'lib/stash_core_api/pull_requests.rb', line 32

def info(pull_request_id)
  perform_get("/pull-requests/#{pull_request_id}")
end