Module: Octokit::Request
- Included in:
- Client
- Defined in:
- lib/octokit/request.rb
Instance Method Summary collapse
- #delete(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
- #get(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
- #patch(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
- #post(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
- #put(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
- #ratelimit ⇒ Object (also: #rate_limit)
- #ratelimit_remaining ⇒ Object (also: #rate_limit_remaining)
Instance Method Details
#delete(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
5 6 7 |
# File 'lib/octokit/request.rb', line 5 def delete(path, ={}, version=api_version, authenticate=true, raw=false, force_urlencoded=false) request(:delete, path, , version, authenticate, raw, force_urlencoded) end |
#get(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
9 10 11 |
# File 'lib/octokit/request.rb', line 9 def get(path, ={}, version=api_version, authenticate=true, raw=false, force_urlencoded=false) request(:get, path, , version, authenticate, raw, force_urlencoded) end |
#patch(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
13 14 15 |
# File 'lib/octokit/request.rb', line 13 def patch(path, ={}, version=api_version, authenticate=true, raw=false, force_urlencoded=false) request(:patch, path, , version, authenticate, raw, force_urlencoded) end |
#post(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
17 18 19 |
# File 'lib/octokit/request.rb', line 17 def post(path, ={}, version=api_version, authenticate=true, raw=false, force_urlencoded=false) request(:post, path, , version, authenticate, raw, force_urlencoded) end |
#put(path, options = {}, version = api_version, authenticate = true, raw = false, force_urlencoded = false) ⇒ Object
21 22 23 |
# File 'lib/octokit/request.rb', line 21 def put(path, ={}, version=api_version, authenticate=true, raw=false, force_urlencoded=false) request(:put, path, , version, authenticate, raw, force_urlencoded) end |
#ratelimit ⇒ Object Also known as: rate_limit
25 26 27 28 |
# File 'lib/octokit/request.rb', line 25 def ratelimit headers = get("rate_limit",{}, api_version, true, true).headers return headers["X-RateLimit-Limit"].to_i end |
#ratelimit_remaining ⇒ Object Also known as: rate_limit_remaining
31 32 33 34 |
# File 'lib/octokit/request.rb', line 31 def ratelimit_remaining headers = get("rate_limit",{}, api_version, true, true).headers return headers["X-RateLimit-Remaining"].to_i end |