class PdkSync::PullRequest

@summary A simple wrapper class around Github pull request and Gitlab merge

request objects used to abstract the differences and provide a common
interface to PR URL and number/id.

Attributes

html_url[R]
number[R]

Public Class Methods

github(pr_object) click to toggle source
# File lib/pdksync/pullrequest.rb, line 6
def github(pr_object)
  new(pr_object)
end
gitlab(pr_object) click to toggle source
# File lib/pdksync/pullrequest.rb, line 10
def gitlab(pr_object)
  new(pr_object, :gitlab)
end
new(pr_object, git_platform = :github) click to toggle source

Create a new PR wrapper object setting html_url and number @param pr_object

The pull request object to wrap as created by Octokit::Client or
Gitlab::Client

@param [Symbol] git_platform

The Git hosting platform against which the pull request is made
# File lib/pdksync/pullrequest.rb, line 25
def initialize(pr_object, git_platform = :github)
  case git_platform
  when :github
    @html_url = pr_object.html_url
    @number = pr_object.number
  when :gitlab
    @html_url = pr_object.web_url
    @number = pr_object.iid
  end
end