Sha256: fd703d0f681f9195f4aeb66f198a54bc3c0a1bcaa70d0c055551d88ca61c69e1
Contents?: true
Size: 644 Bytes
Versions: 17
Compression:
Stored size: 644 Bytes
Contents
module Twitter class RateLimit < Twitter::Base # @return [Integer] def limit limit = @attrs['x-rate-limit-limit'] limit.to_i if limit end memoize :limit # @return [Integer] def remaining remaining = @attrs['x-rate-limit-remaining'] remaining.to_i if remaining end memoize :remaining # @return [Time] def reset_at reset = @attrs['x-rate-limit-reset'] Time.at(reset.to_i) if reset end memoize :reset_at # @return [Integer] def reset_in [(reset_at - Time.now).ceil, 0].max if reset_at end alias_method :retry_after, :reset_in end end
Version data entries
17 entries across 17 versions & 1 rubygems