class Hoss::Transport::Serializers::Serializer

@api private

Attributes

config[R]

Public Class Methods

new(config) click to toggle source
# File lib/hoss/transport/serializers.rb, line 29
def initialize(config)
  @config = config
end

Private Instance Methods

keyword_field(value) click to toggle source
# File lib/hoss/transport/serializers.rb, line 41
def keyword_field(value)
  Util.truncate(value)
end
keyword_object(hash) click to toggle source
# File lib/hoss/transport/serializers.rb, line 45
def keyword_object(hash)
  return unless hash

  hash.tap do |h|
    h.each { |k, v| hash[k] = keyword_field(v) }
  end
end
mixed_object(hash) click to toggle source
# File lib/hoss/transport/serializers.rb, line 53
def mixed_object(hash)
  return unless hash

  hash.tap do |h|
    h.each do |k, v|
      hash[k] = v.is_a?(String) ? keyword_field(v) : v
    end
  end
end
ms(micros) click to toggle source
# File lib/hoss/transport/serializers.rb, line 37
def ms(micros)
  micros.to_f / 1_000
end