class LockDiff::Github::PullRequest
wrapper of github PullRequest
Public Class Methods
new(pull_request)
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 5 def initialize(pull_request) @pr = pull_request end
Public Instance Methods
add_comment(comment)
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 29 def add_comment(comment) Github.client.add_comment(repository, number, comment) end
base_file(path)
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 33 def base_file(path) Github.client.file(repository, path: path, ref: @pr.base.sha) end
base_ref()
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 9 def base_ref @pr.base.ref end
find_content_path(file_name)
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 25 def find_content_path(file_name) Github.client.pull_request_content_path(repository, number, file_name) end
head_file(path)
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 37 def head_file(path) Github.client.file(repository, path: path, ref: @pr.head.sha) end
head_ref()
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 13 def head_ref @pr.head.ref end
number()
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 17 def number @pr.number end
repository()
click to toggle source
# File lib/lock_diff/github/pull_request.rb, line 21 def repository @pr.base.repo.full_name end