Class: Gloo::Objs::StringGenerator
- Inherits:
-
Object
- Object
- Gloo::Objs::StringGenerator
- Defined in:
- lib/gloo/objs/basic/string_generator.rb
Class Method Summary collapse
-
.alphanumeric(len = 10) ⇒ Object
Generate a random alphanumeric string.
-
.base64(len = 12) ⇒ Object
Generate a random base64 string.
-
.hex(len = 10) ⇒ Object
Generate a random hex string.
-
.uuid ⇒ Object
Generate a new UUID.
Class Method Details
.alphanumeric(len = 10) ⇒ Object
Generate a random alphanumeric string.
29 30 31 |
# File 'lib/gloo/objs/basic/string_generator.rb', line 29 def self.alphanumeric len=10 return SecureRandom.alphanumeric( len ) end |
.base64(len = 12) ⇒ Object
Generate a random base64 string.
43 44 45 |
# File 'lib/gloo/objs/basic/string_generator.rb', line 43 def self.base64 len=12 return SecureRandom.base64( len ) end |
.hex(len = 10) ⇒ Object
Generate a random hex string.
36 37 38 |
# File 'lib/gloo/objs/basic/string_generator.rb', line 36 def self.hex len=10 s = SecureRandom.hex( len ) end |
.uuid ⇒ Object
Generate a new UUID.
22 23 24 |
# File 'lib/gloo/objs/basic/string_generator.rb', line 22 def self.uuid return SecureRandom.uuid end |