module UnambiguousString

Constants

ALL_CHARS
AMBIGUOUS
LETTERS
NUMBERS
UNAMBIGUOUS_CHARS
VERSION

Public Class Methods

call(joiner: "-", size: 10, groups: 1) click to toggle source
# File lib/unambiguous_string.rb, line 12
def self.call(joiner: "-", size: 10, groups: 1)
  chars = size.times.map { UNAMBIGUOUS_CHARS.sample }
  groups = chars.each_slice(size / groups).map(&:join)
  groups.join(joiner)
end