Class: ApiKeyTools::Validator
- Inherits:
-
Object
- Object
- ApiKeyTools::Validator
- Defined in:
- lib/api_key_tools.rb
Constant Summary collapse
- TIME_THRESHOLD =
5 minutes or 300 seconds
60 * 5
Instance Method Summary collapse
-
#initialize(encoder, value) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(encoder, value) ⇒ Validator
Returns a new instance of Validator.
27 28 29 30 |
# File 'lib/api_key_tools.rb', line 27 def initialize(encoder, value) @encoder = encoder @value = value end |
Instance Method Details
#valid? ⇒ Boolean
32 33 34 |
# File 'lib/api_key_tools.rb', line 32 def valid? within_time_limit? && @encoder.to_s == @value end |