class KnapsackPro::Utils

Public Class Methods

time_now() click to toggle source
# File lib/knapsack_pro/utils.rb, line 9
def self.time_now
  if defined?(Timecop) && Process.respond_to?(:clock_gettime_without_mock)
    Process.clock_gettime_without_mock(Process::CLOCK_MONOTONIC)
  else
    Process.clock_gettime(Process::CLOCK_MONOTONIC)
  end
end
unsymbolize(obj) click to toggle source
# File lib/knapsack_pro/utils.rb, line 5
def self.unsymbolize(obj)
  JSON.parse(obj.to_json)
end