| Class | ActionFlow::RandomGenerator |
| In: |
lib/action_flow/random_generator.rb
|
| Parent: | Object |
This class is used by the ActionFlow framework to generate the FlowExecutionKey which uniquely identifies a user flow execution.
It creates random alphanumeric strings with upper-case characters.
| Chars | = | ("A".."Z").to_a + ("0".."9").to_a | Defines which characters are used to generate random strings |
Generates a random string of the given length. By default, it‘s 64 characters long.
# File lib/action_flow/random_generator.rb, line 34 def self::random_string(len = 64) # Initial string string = "" # Pick characters at random 1.upto(len) { |i| string << Chars[rand(Chars.size-1)] } # Return the resulting string return string.to_s end