Added v 0.4.0 snapshot.
[twitter4r-core.git] / lib / twitter / client / account.rb
blobc7e0b7a4e838ac0122bcb77b0a30d40dee446364
1 class Twitter::Client
2   @@ACCOUNT_URIS = {
3     :rate_limit_status => '/account/rate_limit_status',
4   }
5   
6   # Provides access to the Twitter rate limit status API.
7   # 
8   # You can find out information about your account status.  Currently the only 
9   # supported type of account status is the <tt>:rate_limit_status</tt> which 
10   # returns a <tt>Twitter::RateLimitStatus</tt> object.
11   # 
12   # Example:
13   #  account_status = client.account_info
14   #  puts account_status.remaining_hits
15   def account_info(type = :rate_limit_status)
16     connection = create_http_connection
17     connection.start do |connection|
18       response = http_connect do |conn|
19         create_http_get_request(@@ACCOUNT_URIS[type])
20       end
21       bless_models(Twitter::RateLimitStatus.unmarshal(response.body))
22     end
23   end
24 end