Sha256: 50ded66970029d5cd4475bcb54038d5ab3db237ce73bc71e2bb6dbcb94777562

Contents?: true

Size: 439 Bytes

Versions: 18

Compression:

Stored size: 439 Bytes

Contents

module Github
  class RatelimitStatus
    include Github::Constants

    attr_reader :ratelimit_limit, :ratelimit_remaining

    def initialize(env)
      @env = env
      @ratelimit_limit     = env[:response_headers][RATELIMIT_LIMIT]
      @ratelimit_remaining = env[:response_headers][RATELIMIT_REMAINING]
    end

    def ratelimit_reset_time
      @ratelimit_reset_time ||= Time.parse(@env[:reponse_headers]['date'])
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
github_api-0.6.3 lib/github_api/ratelimit_status.rb
github_api-0.6.2 lib/github_api/ratelimit_status.rb
github_api-0.6.1 lib/github_api/ratelimit_status.rb
github_api-0.6.0 lib/github_api/ratelimit_status.rb
github_api-0.5.4 lib/github_api/ratelimit_status.rb
github_api-0.5.3 lib/github_api/ratelimit_status.rb
github_api-0.5.2 lib/github_api/ratelimit_status.rb
github_api-0.5.1 lib/github_api/ratelimit_status.rb
github_api-0.5.0 lib/github_api/ratelimit_status.rb
github_api-0.5.0.rc1 lib/github_api/ratelimit_status.rb
github_api-0.4.11 lib/github_api/ratelimit_status.rb
github_api-0.4.10 lib/github_api/ratelimit_status.rb
github_api-0.4.9 lib/github_api/ratelimit_status.rb
github_api-0.4.8 lib/github_api/ratelimit_status.rb
github_api-0.4.7 lib/github_api/ratelimit_status.rb
github_api-0.4.6 lib/github_api/ratelimit_status.rb
github_api-0.4.5 lib/github_api/ratelimit_status.rb
github_api-0.4.4 lib/github_api/ratelimit_status.rb