Module: Octokit::Request

Included in:
Client
Defined in:
lib/octokit/request.rb

Instance Method Summary collapse

Instance Method Details

#delete(path, options = {}) ⇒ Object



6
7
8
# File 'lib/octokit/request.rb', line 6

def delete(path, options={})
  request(:delete, path, options).body
end

#get(path, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/octokit/request.rb', line 10

def get(path, options={})
  response = request(:get, path, options)
  body = response.body

  if auto_traversal && body.is_a?(Array)
    while next_url = links(response)["next"]
      response = request(:get, next_url, options)
      body += response.body
    end
  end

  body
end

#patch(path, options = {}) ⇒ Object



24
25
26
# File 'lib/octokit/request.rb', line 24

def patch(path, options={})
  request(:patch, path, options).body
end

#post(path, options = {}) ⇒ Object



28
29
30
# File 'lib/octokit/request.rb', line 28

def post(path, options={})
  request(:post, path, options).body
end

#put(path, options = {}) ⇒ Object



32
33
34
# File 'lib/octokit/request.rb', line 32

def put(path, options={})
  request(:put, path, options).body
end