module Samlr::Tools::Timestamp
Public Class Methods
not_before?(time)
click to toggle source
True when the current time is not before the given time
# File lib/samlr/tools/timestamp.rb, line 20 def self.not_before?(time) Time.now.to_i >= (time.to_i - Samlr.jitter.to_i) end
not_on_or_after?(time)
click to toggle source
Is the current time on or after the given time?
# File lib/samlr/tools/timestamp.rb, line 15 def self.not_on_or_after?(time) Time.now.to_i <= (time.to_i + Samlr.jitter.to_i) end
parse(value)
click to toggle source
# File lib/samlr/tools/timestamp.rb, line 10 def self.parse(value) Time.iso8601(value) end
stamp(time = Time.now)
click to toggle source
Generate a current timestamp in ISO8601 format
# File lib/samlr/tools/timestamp.rb, line 6 def self.stamp(time = Time.now) time.utc.iso8601 end