Permalink
Browse files

Remove Twitter::API#rate_limit_status

  • Loading branch information...
1 parent e4a7015 commit ffebee6638875d5cc8363599fcfab2058bf1baf9 @sferik committed Sep 10, 2012
View
@@ -273,7 +273,7 @@ Here are some fun facts about the 3.0 release:
* The entire library is implemented in just 2,000 lines of code
* With over 5,000 lines of specs, the spec-to-code ratio is over 2.5:1
-* The spec suite contains 648 examples and runs in under 2 seconds on a MacBook
+* The spec suite contains 644 examples and runs in under 2 seconds on a MacBook
* This project has 100% C0 code coverage (the tests execute every line of
source code at least once)
* At the time of release, this library is comprehensive: you can request all
View
@@ -12,7 +12,6 @@
require 'twitter/list'
require 'twitter/oembed'
require 'twitter/place'
-require 'twitter/rate_limit_status'
require 'twitter/relationship'
require 'twitter/saved_search'
require 'twitter/search_results'
@@ -29,20 +28,6 @@ module API
MAX_USERS_PER_REQUEST = 100
MAX_TWEETS_PER_REQUEST = 200
- # Returns the remaining number of API requests available to the requesting user
- #
- # @see https://dev.twitter.com/docs/api/1.1/get/application/rate_limit_status
- # @rate_limited No
- # @authentication_required Requires user context
- # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
- # @return [Twitter::RateLimitStatus]
- # @param options [Hash] A customizable set of options.
- # @example Return the remaining number of API requests available to the requesting user
- # Twitter.rate_limit_status
- def rate_limit_status(options={})
- object_from_response(Twitter::RateLimitStatus, :get, "/1.1/application/rate_limit_status.json", options)
- end
-
# Returns the requesting user if authentication was successful, otherwise raises {Twitter::Error::Unauthorized}
#
# @see https://dev.twitter.com/docs/api/1.1/get/account/verify_credentials
@@ -1,21 +0,0 @@
-require 'twitter/base'
-
-module Twitter
- class RateLimitStatus < Twitter::Base
- attr_reader :hourly_limit, :remaining_hits, :reset_time_in_seconds
-
- # Time when the authenticating user's rate limit will be reset
- #
- # @return [Time]
- def reset_time
- @reset_time ||= Time.parse(@attrs[:reset_time]) if reset_time?
- end
-
- private
-
- def reset_time?
- !@attrs[:reset_time].nil?
- end
-
- end
-end
@@ -1,26 +0,0 @@
-require 'helper'
-
-describe Twitter::API do
-
- before do
- @client = Twitter::Client.new
- end
-
- describe "#rate_limit_status" do
- before do
- stub_get("/1.1/application/rate_limit_status.json").
- to_return(:body => fixture("rate_limit_status.json"), :headers => {:content_type => "application/json; charset=utf-8"})
- end
- it "requests the correct resource" do
- @client.rate_limit_status
- a_get("/1.1/application/rate_limit_status.json").
- should have_been_made
- end
- it "returns the remaining number of API requests available to the requesting user before the API limit is reached" do
- rate_limit_status = @client.rate_limit_status
- rate_limit_status.should be_a Twitter::RateLimitStatus
- rate_limit_status.remaining_hits.should eq 19993
- end
- end
-
-end
@@ -1,16 +0,0 @@
-require 'helper'
-
-describe Twitter::RateLimitStatus do
-
- describe "#reset_time" do
- it "returns a Time when reset_time is set" do
- rate_limit_status = Twitter::RateLimitStatus.new(:reset_time => "Mon Jul 16 12:59:01 +0000 2007")
- rate_limit_status.reset_time.should be_a Time
- end
- it "returns nil when reset_time is not set" do
- rate_limit_status = Twitter::RateLimitStatus.new
- rate_limit_status.reset_time.should be_nil
- end
- end
-
-end

0 comments on commit ffebee6

Please sign in to comment.