Class: RandomToken

Inherits:
String
  • Object
show all
Defined in:
lib/random_token.rb

Constant Summary collapse

COUNT =
16
CHARS =
['a','b','c','d','e','f','g','h','j','k','m','n','p','r','s','t','u','v','w','x','y','z']

Instance Method Summary collapse

Constructor Details

#initializeRandomToken

Returns a new instance of RandomToken.


32
33
34
# File 'lib/random_token.rb', line 32

def initialize
  super(Array.new(COUNT){CHARS[SecureRandom.random_number(CHARS.size)]}.join)
end