Class: TheCity::RateLimit

Inherits:
Base
  • Object
show all
Defined in:
lib/the_city/rate_limit.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, from_response, #initialize, #memoize, object_attr_reader, uri_attr_reader

Constructor Details

This class inherits a constructor from TheCity::Base

Instance Method Details

#limitInteger

Returns:

  • (Integer)


5
6
7
8
# File 'lib/the_city/rate_limit.rb', line 5

def limit
  limit = @attrs['x-rate-limit-limit']
  limit.to_i if limit
end

#remainingInteger

Returns:

  • (Integer)


11
12
13
14
# File 'lib/the_city/rate_limit.rb', line 11

def remaining
  remaining = @attrs['x-rate-limit-remaining']
  remaining.to_i if remaining
end