Module: Authentication::ModelClassMethods

Defined in:
lib/authentication.rb

Instance Method Summary collapse

Instance Method Details

#make_tokenObject



33
34
35
# File 'lib/authentication.rb', line 33

def make_token
  secure_digest(Time.now, (1..10).map{ rand.to_s })
end

#secure_digest(*args) ⇒ Object



29
30
31
# File 'lib/authentication.rb', line 29

def secure_digest(*args)
  Digest::SHA1.hexdigest(args.flatten.join('--'))
end