Module: Qyu::Utils
- Defined in:
- lib/qyu/utils.rb
Overview
Qyu::Utils
Class Method Summary collapse
-
.seconds_after_time(seconds, start_time = Time.now) ⇒ Time
Calculates end time after a number of seconds.
-
.stringify_hash_keys(object) ⇒ String
Convert all hash keys to strings.
-
.uuid ⇒ String
Generates a unique UUID.
Class Method Details
.seconds_after_time(seconds, start_time = Time.now) ⇒ Time
Calculates end time after a number of seconds
11 12 13 |
# File 'lib/qyu/utils.rb', line 11 def self.seconds_after_time(seconds, start_time = Time.now) start_time + seconds end |
.stringify_hash_keys(object) ⇒ String
Convert all hash keys to strings
26 27 28 |
# File 'lib/qyu/utils.rb', line 26 def self.stringify_hash_keys(object) object.map { |k, v| [k.to_s, v] }.to_h end |
.uuid ⇒ String
Generates a unique UUID
18 19 20 |
# File 'lib/qyu/utils.rb', line 18 def self.uuid SecureRandom.uuid end |