Class: Ondotori::WebAPI::Api::RateLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/ondotori/webapi/api/rate_limit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RateLimit

Returns a new instance of RateLimit.



9
10
11
12
13
# File 'lib/ondotori/webapi/api/rate_limit.rb', line 9

def initialize(response)
  @limit     = response.get_fields("X-RateLimit-Limit")
  @reset     = response.get_fields("X-RateLimit-Reset")
  @remaining = response.get_fields("X-RateLimit-Remaining")
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



7
8
9
# File 'lib/ondotori/webapi/api/rate_limit.rb', line 7

def limit
  @limit
end

#remainingObject (readonly)

Returns the value of attribute remaining.



7
8
9
# File 'lib/ondotori/webapi/api/rate_limit.rb', line 7

def remaining
  @remaining
end

#resetObject (readonly)

Returns the value of attribute reset.



7
8
9
# File 'lib/ondotori/webapi/api/rate_limit.rb', line 7

def reset
  @reset
end