Class: Limiter::Points

Inherits:
Client
  • Object
show all
Defined in:
lib/limiter/points.rb

Constant Summary

Constants inherited from Client

Client::BASE_DOMAIN

Instance Attribute Summary

Attributes inherited from Client

#identifier, #limit, #namespace, #period, #token

Instance Method Summary collapse

Methods inherited from Client

#check, #formatted_period, #initialize, #request

Constructor Details

This class inherits a constructor from Limiter::Client

Instance Method Details

#urlObject



6
7
8
# File 'lib/limiter/points.rb', line 6

def url
  "#{BASE_DOMAIN}/points/#{namespace}/#{limit}/#{formatted_period}/#{identifier}"
end

#used(points) ⇒ Object



10
11
12
# File 'lib/limiter/points.rb', line 10

def used(points)
  RateLimitResponse.new(request({ used: points.to_i }))
end