Class: Hoss::Transport::Serializers::Container Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hoss/transport/serializers.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 collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Container

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.

Returns a new instance of Container.



66
67
68
69
70
71
72
73
74
# File 'lib/hoss/transport/serializers.rb', line 66

def initialize(config)
  # @transaction = Serializers::TransactionSerializer.new(config)
  # @span = Serializers::SpanSerializer.new(config)
  @report = Serializers::ReportSerializer.new(config)
  @event = Serializers::EventSerializer.new(config)
  @error = Serializers::ErrorSerializer.new(config)
  @metadata = Serializers::MetadataSerializer.new(config)
  # @metricset = Serializers::MetricsetSerializer.new(config)
end

Instance Attribute Details

#errorObject (readonly)

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.



76
77
78
# File 'lib/hoss/transport/serializers.rb', line 76

def error
  @error
end

#eventObject (readonly)

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.



76
77
78
# File 'lib/hoss/transport/serializers.rb', line 76

def event
  @event
end

#metadataObject (readonly)

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.



76
77
78
# File 'lib/hoss/transport/serializers.rb', line 76

def 
  @metadata
end

#metricsetObject (readonly)

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.



76
77
78
# File 'lib/hoss/transport/serializers.rb', line 76

def metricset
  @metricset
end

#reportObject (readonly)

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.



76
77
78
# File 'lib/hoss/transport/serializers.rb', line 76

def report
  @report
end

Instance Method Details

#serialize(resource) ⇒ 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.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/hoss/transport/serializers.rb', line 77

def serialize(resource)
  case resource
  # when Transaction
  #   transaction.build(resource)
  # when Span
  #   span.build(resource)
  when Report
    report.build(resource)
  when Event
    event.build(resource)
  when Error
    error.build(resource)
  # when Metricset
  #   metricset.build(resource)
  when Metadata
    .build(resource)
  else
    raise UnrecognizedResource, resource.inspect
  end
end