Class: Lite::Uxid::Nanoid

Inherits:
Base
  • Object
show all
Defined in:
lib/lite/uxid/nanoid.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#encoding_base, #initialize

Constructor Details

This class inherits a constructor from Lite::Uxid::Base

Class Method Details

.encodeObject


9
10
11
12
# File 'lib/lite/uxid/nanoid.rb', line 9

def encode
  klass = new
  klass.encode
end

Instance Method Details

#encodeObject


16
17
18
# File 'lib/lite/uxid/nanoid.rb', line 16

def encode
  encoding_chars.chars.sample(encoding_length).join
end