Class: KnapsackPro::Utils
- Inherits:
-
Object
- Object
- KnapsackPro::Utils
- Defined in:
- lib/knapsack_pro/utils.rb
Class Method Summary collapse
Class Method Details
.time_now ⇒ Object
9 10 11 12 13 14 15 |
# 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) ⇒ Object
5 6 7 |
# File 'lib/knapsack_pro/utils.rb', line 5 def self.unsymbolize(obj) JSON.parse(obj.to_json) end |