module TimestampResolution

Public Instance Methods

timestamp_in(resolution = nil) click to toggle source
# File lib/TrRMIte/event.rb, line 15
def timestamp_in(resolution = nil)
  case resolution
  when nil, :seconds then timestamp
  when :milliseconds then (timestamp * 1_000).to_i
  else
    raise "Invalid timestamp resolution: #{resolution}"
  end
end