Class: Authmac::TimestampChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/authmac/timestamp_checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_behind, max_ahead) ⇒ TimestampChecker

Returns a new instance of TimestampChecker.



3
4
5
6
# File 'lib/authmac/timestamp_checker.rb', line 3

def initialize(max_behind, max_ahead)
  @max_behind = max_behind
  @max_ahead  = max_ahead
end

Instance Method Details

#validate(timestamp) ⇒ Object



8
9
10
# File 'lib/authmac/timestamp_checker.rb', line 8

def validate(timestamp)
  not_too_old(timestamp) and not_too_new(timestamp)
end