Skip to content

Commit

Permalink
Add rate_limit attribute to Twitter::Request
Browse files Browse the repository at this point in the history
References #626.
  • Loading branch information
sferik committed Nov 4, 2014
1 parent c132e3d commit 0c9f9d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/twitter/request.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require 'twitter/cursor'
require 'twitter/rate_limit'

module Twitter
class Request
attr_accessor :client, :request_method, :path, :options
attr_accessor :client, :rate_limit, :request_method, :path, :options
alias_method :verb, :request_method

# @param client [Twitter::Client]
Expand All @@ -19,7 +20,9 @@ def initialize(client, request_method, path, options = {})

# @return [Hash]
def perform
@client.send(@request_method, @path, @options).body
response = @client.send(@request_method, @path, @options)
@rate_limit = Twitter::RateLimit.new(response.response_headers)
response.body
end

# @param klass [Class]
Expand Down

0 comments on commit 0c9f9d6

Please sign in to comment.