class SecretKey::SecretKey

Attributes

key[R]
secret[R]
timestamp[R]

Public Class Methods

new(key, secret, timestamp: Time.now.to_i) click to toggle source
# File lib/secretkey.rb, line 7
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

Public Instance Methods

token() click to toggle source
# File lib/secretkey.rb, line 15
def token
  Digest::SHA1.hexdigest("#{key}:#{secret}:#{timestamp}")
end