Module: Spg

Defined in:
lib/spg.rb,
lib/spg/version.rb,
lib/spg/symbol_set.rb

Defined Under Namespace

Modules: SymbolSet

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.generate(symbol_sets: %i(lowercase numeral),, length: 10, readable: false) ⇒ Object



6
7
8
9
10
# File 'lib/spg.rb', line 6

def generate(symbol_sets: %i(lowercase numeral), length: 10, readable: false)
  symbols  = symbol_sets.map{ |symbol_set| SymbolSet.send(symbol_set) }.flatten
  symbols -= SymbolSet.unreadable if readable
  (1..length).map{ symbols.sample }.join
end