Module: Kameleoon::Utils

Defined in:
lib/kameleoon/utils.rb

Constant Summary collapse

ALPHA_NUMERIC_CHARS =
'abcdef0123456789'

Class Method Summary collapse

Class Method Details

.generate_random_string(length) ⇒ Object



9
10
11
# File 'lib/kameleoon/utils.rb', line 9

def self.generate_random_string(length)
  (1..length).map { ALPHA_NUMERIC_CHARS[rand(ALPHA_NUMERIC_CHARS.length)] }.join
end

.in_seconds(days) ⇒ Object



5
6
7
# File 'lib/kameleoon/utils.rb', line 5

def self.in_seconds(days)
  days * 60 * 60 * 24
end