module Qyu::Utils
Public Class Methods
seconds_after_time(seconds, start_time = Time.now)
click to toggle source
Calculates end time after a number of seconds
@param seconds [Integer] number of seconds after time @param start_time [Time] time to start from @return [Time] end time
# 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)
click to toggle source
Convert all hash keys to strings
@param object [Hash] Hash to stringify its keys @return [String] Hash with string keys
# 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()
click to toggle source
Generates a unique UUID
@return [String] UUID
# File lib/qyu/utils.rb, line 18 def self.uuid SecureRandom.uuid end