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("repos/#{Repository.new(repo)}/pulls", options.merge(pull))
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("repos/#{Repository.new(repo)}/pulls", options.merge(pull))
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("repos/#{Repository.new(repo)}/pulls/#{number}", options)
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("repos/#{Repository.new(repo)}/pulls", options.merge({:state => state}), 3)
end