class Amplitude::Formatters::Time

Public Class Methods

call(time) click to toggle source
# File lib/amplitude/formatters/time.rb, line 4
def call(time)
  return time if time.nil?
  guess = time.to_i
  ::Time.at(guess) > ::Time.now ? guess : convert_to_ms(time)
end
convert_to_ms(time) click to toggle source
# File lib/amplitude/formatters/time.rb, line 10
def convert_to_ms(time)
  (time.to_f * 1_000).to_i
end