Module: Octokit::Client::Pulls

Included in:
Octokit::Client
Defined in:
lib/octokit/client/pulls.rb

Instance Method Summary collapse

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, options={})
  pull = {
    :base  => base,
    :head  => head,
    :title => title,
    :body  => body,
  }
  post("/api/v2/json/pulls/#{Repository.new(repo)}", options.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, options={})
  pull = {
    :base  => base,
    :head  => head,
    :issue => issue
  }
  post("/api/v2/json/pulls/#{Repository.new(repo)}", options.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, options={})
  get("/api/v2/json/pulls/#{Repository.new(repo)}/#{number}", options)['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', options={})
  get("/api/v2/json/pulls/#{Repository.new(repo)}/#{state}", options)['pulls']
end