Class: Skylight::Normalizers::Container Private
- Defined in:
- lib/skylight/normalizers.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 Method Summary collapse
- #each_key(&block) ⇒ Object private
-
#initialize(normalizers) ⇒ Container
constructor
private
A new instance of Container.
- #keys ⇒ Object private
- #normalize(trace, name, payload) ⇒ Object private
- #normalize_after(trace, span, name, payload) ⇒ Object private
- #normalizer_for(name) ⇒ Object private
Constructor Details
#initialize(normalizers) ⇒ 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.
101 102 103 |
# File 'lib/skylight/normalizers.rb', line 101 def initialize(normalizers) @normalizers = normalizers end |
Instance Method Details
#each_key(&block) ⇒ 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.
109 110 111 |
# File 'lib/skylight/normalizers.rb', line 109 def each_key(&block) @normalizers.each_key(&block) end |
#keys ⇒ 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.
105 106 107 |
# File 'lib/skylight/normalizers.rb', line 105 def keys @normalizers.keys end |
#normalize(trace, name, payload) ⇒ 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.
113 114 115 |
# File 'lib/skylight/normalizers.rb', line 113 def normalize(trace, name, payload) normalizer_for(name).(trace, name, payload) end |
#normalize_after(trace, span, name, payload) ⇒ 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.
117 118 119 |
# File 'lib/skylight/normalizers.rb', line 117 def normalize_after(trace, span, name, payload) normalizer_for(name).normalize_after(trace, span, name, payload) end |
#normalizer_for(name) ⇒ 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.
121 122 123 124 125 126 |
# File 'lib/skylight/normalizers.rb', line 121 def normalizer_for(name) # We never expect to hit the default case since we only register listeners # for items that we know have normalizers. For now, though, we'll play it # safe and provide a fallback. @normalizers.fetch(name, DEFAULT) end |