class Sysdig::Model

Public Class Methods

epoch_time(v, options={}) click to toggle source
# File lib/sysdig/model.rb, line 2
def self.epoch_time(v, options={})
  divisor = options[:divisor] || 1_000

  case v
  when Time then v
  when Numeric then Time.at(v / divisor)
  else nil
  end
end
microsecond_datetime(v, *) click to toggle source
# File lib/sysdig/model.rb, line 12
def self.microsecond_datetime(v, *)
  i = v.to_i

  i > 1_000_000 ? i / 1_000_000 : i
end
upcase(v, *) click to toggle source
# File lib/sysdig/model.rb, line 18
def self.upcase(v, *)
  v.nil? ? v : v.to_s.upcase
end