Method: Chars::CharSet#random_distinct_string

Defined in:
lib/chars/char_set.rb

#random_distinct_string(length, **kwargs) ⇒ String

Creates a String containing randomly selected non-repeating characters from the Chars::CharSet.

Parameters:

  • length (Integer, Array, Range)

    The length of the String of random non-repeating characters.

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments.

Options Hash (**kwargs):

  • :random (Random, SecureRandom)

    The random number generator to use.

Returns:

  • (String)

    The String of randomly selected non-repeating characters.

See Also:



393
394
395
# File 'lib/chars/char_set.rb', line 393

def random_distinct_string(length,**kwargs)
  random_distinct_chars(length,**kwargs).join
end