Permalink
Browse files

Creates a head method to be more consistent.

  • Loading branch information...
1 parent 1e0395d commit 92bc4c319a8aabaf4c51ccb973535679d8299d8b @icco icco committed May 25, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/octokit/request.rb
View
8 lib/octokit/request.rb
@@ -22,18 +22,22 @@ def put(path, options={}, version=api_version, authenticate=true, raw=false, for
request(:put, path, options, version, authenticate, raw, force_urlencoded)
end
+ def head(path, options={}, version=api_version, authenticate=true, raw=true, force_urlencoded=false)
+ request(:head, path, options, version, authenticate, raw, force_urlencoded)
+ end
+
def ratelimit(force=false)
headers = @last_header
if @last_header == nil || force
- headers = request(:head, "/", {}, api_version, true, true, false)
+ headers = head("/")
end
return headers["X-RateLimit-Limit"].to_i
end
def ratelimit_remaining(force=false)
headers = @last_header
if @last_header == nil || force
- headers = request(:head, "/", {}, api_version, true, true, false)
+ headers = head("/")
end
return headers["X-RateLimit-Remaining"].to_i
end

0 comments on commit 92bc4c3

Please sign in to comment.