When I Search with Twitter Gem Remaining Rate Limit Is Decremented Twice

rate-limits
ruby
search

#1

I am looking for a way to check Twitter API rate limits before of making my consults but for the next snippet every time I call search , remaining is decremented twice instead of just once.

user = User.find_by_id(ID)
client = Twitter::REST::Client.new do |config|
  config.consumer_key = CONSUMER_KEY
  config.consumer_secret = CONSUMER_SECRECT
  config.access_token = user.access_token
  config.access_token_secret = user.access_token_secret
end

client.search("baeza")
puts Twitter::REST::Request.new(client, :get, 'https://api.twitter.com/1.1/application/rate_limit_status.json', resources: "search").perform
client.search("baeza")
puts Twitter::REST::Request.new(client, :get, 'https://api.twitter.com/1.1/application/rate_limit_status.json', resources: "search").perform

I am getting the next result:

{:rate_limit_context=>{:access_token=>"access_token"}, :resources=>{:search=>{:"/search/tweets"=>{:limit=>180, :remaining=>178, :reset=>1465385167}}}}
{:rate_limit_context=>{:access_token=>"access_token"}, :resources=>{:search=>{:"/search/tweets"=>{:limit=>180, :remaining=>176, :reset=>1465385167}}}}

I would appreciate hearing your thoughts. Thanks for reading!