Class: Gloo::Objs::StringGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/gloo/objs/basic/string_generator.rb

Class Method Summary collapse

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

.uuidObject

Generate a new UUID.



22
23
24
# File 'lib/gloo/objs/basic/string_generator.rb', line 22

def self.uuid
  return SecureRandom.uuid
end