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("pulls/#{Repository.new(repo)}", options.merge({:pull => pull}))['pulls']
end

#pull_request(repo, number, options = {}) ⇒ Object Also known as: pull



19
20
21
# File 'lib/octokit/client/pulls.rb', line 19

def pull_request(repo, number, options={})
  get("pulls/#{Repository.new(repo)}/#{number}", options)['pull']
end

#pull_requests(repo, state = 'open', options = {}) ⇒ Object Also known as: pulls



14
15
16
# File 'lib/octokit/client/pulls.rb', line 14

def pull_requests(repo, state='open', options={})
  get("pulls/#{Repository.new(repo)}/#{state}", options)['pulls']
end