Class: Nexaas::Throttle::Guardian
- Inherits:
-
Object
- Object
- Nexaas::Throttle::Guardian
- Defined in:
- lib/nexaas/throttle/guardian.rb
Instance Method Summary collapse
-
#initialize(request, configuration) ⇒ Guardian
constructor
A new instance of Guardian.
- #throttle! ⇒ Object
- #track! ⇒ Object
Constructor Details
#initialize(request, configuration) ⇒ Guardian
Returns a new instance of Guardian.
6 7 8 9 10 |
# File 'lib/nexaas/throttle/guardian.rb', line 6 def initialize(request, configuration) @request = request @token = configuration.request_identifier.new(request).token @ignored_user_agents = configuration.ignored_user_agents end |
Instance Method Details
#throttle! ⇒ Object
12 13 14 |
# File 'lib/nexaas/throttle/guardian.rb', line 12 def throttle! validate { token } end |
#track! ⇒ Object
16 17 18 |
# File 'lib/nexaas/throttle/guardian.rb', line 16 def track! validate { true } end |