Module: Helpers

Included in:
Command::Base, Config
Defined in:
lib/core/helpers.rb

Instance Method Summary collapse

Instance Method Details

#random_four_digitsObject



13
14
15
# File 'lib/core/helpers.rb', line 13

def random_four_digits
  SecureRandom.random_number(1000..9999)
end

#strip_str_and_validate(str) ⇒ Object



6
7
8
9
10
11
# File 'lib/core/helpers.rb', line 6

def strip_str_and_validate(str)
  return str if str.nil?

  str = str.strip
  str.empty? ? nil : str
end