Module: Octokit::Client::Pulls
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/pulls.rb
Instance Method Summary collapse
- #create_pull_request(repo, base, head, title, body, options = {}) ⇒ Object
- #create_pull_request_for_issue(repo, base, head, issue, options = {}) ⇒ Object
- #pull_request(repo, number, options = {}) ⇒ Object (also: #pull)
- #pull_requests(repo, state = 'open', options = {}) ⇒ Object (also: #pulls)
Instance Method Details
#create_pull_request(repo, base, head, title, body, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/octokit/client/pulls.rb', line 4 def create_pull_request(repo, base, head, title, body, ={}) pull = { :base => base, :head => head, :title => title, :body => body, } post("/api/v2/json/pulls/#{Repository.new(repo)}", .merge({:pull => pull}))['pulls'] end |
#create_pull_request_for_issue(repo, base, head, issue, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/octokit/client/pulls.rb', line 14 def create_pull_request_for_issue(repo, base, head, issue, ={}) pull = { :base => base, :head => head, :issue => issue } post("/api/v2/json/pulls/#{Repository.new(repo)}", .merge({:pull => pull}))['pulls'] end |
#pull_request(repo, number, options = {}) ⇒ Object Also known as: pull
28 29 30 |
# File 'lib/octokit/client/pulls.rb', line 28 def pull_request(repo, number, ={}) get("/api/v2/json/pulls/#{Repository.new(repo)}/#{number}", )['pull'] end |
#pull_requests(repo, state = 'open', options = {}) ⇒ Object Also known as: pulls
23 24 25 |
# File 'lib/octokit/client/pulls.rb', line 23 def pull_requests(repo, state='open', ={}) get("/api/v2/json/pulls/#{Repository.new(repo)}/#{state}", )['pulls'] end |