Module: Github::Request::Verbs

Included in:
API
Defined in:
lib/github_api2/request/verbs.rb

Overview

Defines HTTP verbs

Instance Method Summary collapse

Instance Method Details

#delete_request(path, params = ParamsHash.empty) ⇒ Object

Make a delete request



51
52
53
# File 'lib/github_api2/request/verbs.rb', line 51

def delete_request(path, params = ParamsHash.empty)
  Request.new(:delete, path, self).call(current_options, params)
end

#get_request(path, params = ParamsHash.empty) ⇒ Object

Make a get request



22
23
24
25
# File 'lib/github_api2/request/verbs.rb', line 22

def get_request(path, params = ParamsHash.empty)
  request = Request.new(:get, path, self).call(current_options, params)
  request.auto_paginate
end

#head_request(path, params = ParamsHash.empty) ⇒ Object

Make a head request



15
16
17
# File 'lib/github_api2/request/verbs.rb', line 15

def head_request(path, params = ParamsHash.empty)
  Request.new(:head, path, self).call(current_options, params)
end

#options_request(path, params = ParamsHash.empty) ⇒ Object

Make a options request



58
59
60
# File 'lib/github_api2/request/verbs.rb', line 58

def options_request(path, params = ParamsHash.empty)
  Request.new(:options, path, self).call(current_options, params)
end

#patch_request(path, params = ParamsHash.empty) ⇒ Object

Make a patch request



30
31
32
# File 'lib/github_api2/request/verbs.rb', line 30

def patch_request(path, params = ParamsHash.empty)
  Request.new(:patch, path, self).call(current_options, params)
end

#post_request(path, params = ParamsHash.empty) ⇒ Object

Make a post request



37
38
39
# File 'lib/github_api2/request/verbs.rb', line 37

def post_request(path, params = ParamsHash.empty)
  Request.new(:post, path, self).call(current_options, params)
end

#put_request(path, params = ParamsHash.empty) ⇒ Object

Make a put request



44
45
46
# File 'lib/github_api2/request/verbs.rb', line 44

def put_request(path, params = ParamsHash.empty)
  Request.new(:put, path, self).call(current_options, params)
end