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.

Methods

Constants

Chars = ("A".."Z").to_a + ("0".."9").to_a   Defines which characters are used to generate random strings

Public Class methods

Generates a random string of the given length. By default, it‘s 64 characters long.

[Source]

# 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

[Validate]