Create a new InstanceVariableWriteNode
node
Create a new IntegerNode
node
Create a new InterpolatedMatchLastLineNode
node
Create a new InterpolatedStringNode
node
Create a new InterpolatedSymbolNode
node
Create a new InterpolatedXStringNode
node
Create a new LocalVariableAndWriteNode
node
Create a new LocalVariableOrWriteNode
node
Create a new LocalVariableWriteNode
node
Create a new MultiWriteNode
node
Create a new PinnedVariableNode
node
Create a new RedoNode
node
Create a new RescueModifierNode
node
Create a new SelfNode
node
Create a new SingletonClassNode
node
Create a new SuperNode
node
Create a new UntilNode
node
Generate a random base64 string.
The argument n specifies the length, in bytes, of the random number to be generated. The length of the result string is about 4/3 of n.
If n is not specified or is nil, 16 is assumed. It may be larger in the future.
The result may contain A-Z, a-z, 0-9, “+”, “/” and “=”.
require 'random/formatter' Random.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A==" # or prng = Random.new prng.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
See RFC 3548 for the definition of base64.
Generate a string that randomly draws from a source array of characters.
The argument source specifies the array of characters from which to generate the string. The argument n specifies the length, in characters, of the string to be generated.
The result may contain whatever characters are in the source array.
require 'random/formatter' prng.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron" prng.choose([*'0'..'9'], 5) #=> "27309"
Generate a random alphanumeric string.
The argument n specifies the length, in characters, of the alphanumeric string to be generated. The argument chars specifies the character list which the result is consist of.
If n is not specified or is nil, 16 is assumed. It may be larger in the future.
The result may contain A-Z, a-z and 0-9, unless chars is specified.
require 'random/formatter' Random.alphanumeric #=> "2BuBuLf3WfSKyQbR" # or prng = Random.new prng.alphanumeric(10) #=> "i6K93NdqiH" Random.alphanumeric(4, chars: [*"0".."9"]) #=> "2952" # or prng = Random.new prng.alphanumeric(10, chars: [*"!".."/"]) #=> ",.,++%/''."
Resets the trust directory for verifying gems.