Sha256: 2a41133252933f400c4d8d3cfd380fb17aa3540b7f4228ac26617352bc4658f3

Contents?: true

Size: 481 Bytes

Versions: 7

Compression:

Stored size: 481 Bytes

Contents

module Octokit
  class Client
    module RateLimit

      def ratelimit(options={})
        headers = request(:get, "rate_limit", options).headers
        return headers["X-RateLimit-Limit"].to_i
      end
      alias rate_limit ratelimit

      def ratelimit_remaining(options={})
        headers = request(:get, "rate_limit", options).headers
        return headers["X-RateLimit-Remaining"].to_i
      end
      alias rate_limit_remaining ratelimit_remaining

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
octokit-1.25.0 lib/octokit/client/rate_limit.rb
octokit-1.24.0 lib/octokit/client/rate_limit.rb
octokit-1.23.0 lib/octokit/client/rate_limit.rb
octokit-1.22.0 lib/octokit/client/rate_limit.rb
octokit-1.21.0 lib/octokit/client/rate_limit.rb
octokit-1.20.0 lib/octokit/client/rate_limit.rb
octokit-1.19.0 lib/octokit/client/rate_limit.rb