Sha256: e10f701a9f6400d028aed4a0bdf80c3b03af9764699dd949bf746392c2826be2
Contents?: true
Size: 422 Bytes
Versions: 1
Compression:
Stored size: 422 Bytes
Contents
require 'digest' module SecretKey class SecretKey attr_reader :key, :secret, :timestamp def initialize(key, secret, timestamp: Time.now.to_i) raise ArgumentError, 'Time Stamp is not a valid integer.' unless timestamp.is_a? Integer @key = key @secret = secret @timestamp = timestamp end def token Digest::SHA1.hexdigest("#{key}:#{secret}:#{timestamp}") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
secretkey-1.1.1 | lib/secretkey.rb |