Class: Hoss::Transport::Serializers::ContextSerializer Private

Inherits:
Serializer
  • Object
show all
Defined in:
lib/hoss/transport/serializers/context_serializer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Serializer

#config

Instance Method Summary collapse

Methods inherited from Serializer

#initialize

Constructor Details

This class inherits a constructor from Hoss::Transport::Serializers::Serializer

Instance Method Details

#build(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hoss/transport/serializers/context_serializer.rb', line 25

def build(context)
  return nil if context.nil? || context.empty?

  {
    custom: context.custom,
    tags: mixed_object(context.labels),
    request: build_request(context.request),
    response: build_response(context.response),
    user: build_user(context.user),
    service: build_service(context.service)
  }
end