class Gf::PullRequest
Public Class Methods
new(pull_request_params)
click to toggle source
# File lib/gf.rb, line 93 def initialize(pull_request_params) @pull_request_params = pull_request_params end
Public Instance Methods
branch_name()
click to toggle source
# File lib/gf.rb, line 105 def branch_name @pull_request_params[:head][:label] end
changed_files()
click to toggle source
# File lib/gf.rb, line 97 def changed_files @changed_files ||= fetch_changed_files end
html_url()
click to toggle source
# File lib/gf.rb, line 101 def html_url @pull_request_params[:_links][:html][:href] end
Private Instance Methods
diff_url()
click to toggle source
# File lib/gf.rb, line 110 def diff_url @pull_request_params['diff_url'] end
fetch_changed_files()
click to toggle source
# File lib/gf.rb, line 114 def fetch_changed_files fetcher = DiffFetcher.new(diff_url) fetcher.fetch! patches = GitDiffParser.parse(fetcher.diff_body) patches.map(&:file) end